Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up
for free
Error handling on Android - 1st Android Athens Meetup
Pavlos-Petros Tournaris
September 22, 2016
Technology
0
120
Error handling on Android - 1st Android Athens Meetup
Pavlos-Petros Tournaris
September 22, 2016
Tweet
Share
Other Decks in Technology
See All in Technology
finengine
0
330
chipstar_light
0
480
yuhta28
0
150
line_developers
PRO
2
170
techharmony
0
160
finengine
0
250
shirayanagiryuji
1
160
kema1015
0
570
yoku0825
PRO
2
660
line_developers
PRO
1
580
1ftseabass
PRO
0
110
akakou
2
360
Featured
See All Featured
jnunemaker
PRO
40
4.7k
holman
288
130k
myddelton
109
11k
jlugia
217
16k
paulrobertlloyd
73
1.5k
philhawksworth
192
8.9k
cromwellryan
104
6.3k
carmenhchung
34
1.6k
holman
448
140k
vanstee
118
4.9k
brad_frost
157
6.5k
colly
188
14k
Transcript
Error Handling Efficient error handling on Android https://github.com/Workable/java-error-handler
Error Handling on Android Vasilis Charalampakis Android Software Engineer @
Workable basilis@workable.com Pavlos-Petros Tournaris Android Software Engineer @ Workable tournaris@workable.com
A common problem in Software
1. Have a default handler for every expected (exceptional, common
or not) error. 2. Handle specific errors as appropriate based on where and when they occur. 3. Have a default catch-all handler for unknown errors. 4. Override any default handler if needed. 5. Keep our code DRY.
Global VS Specific Global Handle an error in a common
way Specific Handle an error specifically for a screen
Approach
Solution https://github.com/Workable/java-error-handler
API • Initialize • Configure • Execute
Initialize • defaultErrorHandler() • create() • createIsolated()
Configure • on(T, Action) • on(Class<? extends Exception>, Action) •
clear() • bindErrorCode(T, MatcherFactory<T>) • bindErrorCodeClass(Class<T>, MatcherFactory<T>)
Configure • skipFollowing() • skipAlways() • skipDefaults() • always(Action) •
otherwise(Action)
Execute • handle(throwable); • run(() -> foo()); // Coming soon…
DEMO https://github.com/pavlospt/error-handler-demo
Thanks!