Created
September 9, 2016 15:39
-
-
Save pavlospt/82d97bd85df38b659ce85b4b33a39a47 to your computer and use it in GitHub Desktop.
ErrorHandler's API - Configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ErrorHandler | |
.defaultErrorHandler() | |
.bindErrorCodeClass(Integer.class, RetrofitMatcherFactory.create()) | |
.bindErrorCodeClass(Range.class, RetrofitMatcherFactory.createRange()) | |
.on(400, (throwable, errorHandler) -> showErrorMessage("what?")) | |
.on(Range.of(500, 599), (throwable, errorHandler) -> showErrorMessage("kaboom")) | |
.handle(httpException); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment