Last active
March 10, 2017 18:21
-
-
Save ragdroid/4227d9e1cab24d0a187f669ed8bdaeee to your computer and use it in GitHub Desktop.
How to be a MockStar - Issue Errors
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
if (throwable instanceof HttpException) { | |
if (((HttpException) throwable).code() == | |
HttpURLConnection.HTTP_NOT_FOUND) { | |
if (getView() != null) { | |
getView().showErrorDialog("Lost!"); | |
} | |
} else if (((HttpException) throwable).code() == | |
HttpURLConnection.HTTP_UNAVAILABLE) { | |
if (getView() != null) { | |
getView().showErrorDialog("Fire on the Server"); | |
} | |
} else if (((HttpException) throwable).code() == | |
HttpURLConnection.HTTP_UNAUTHORIZED) { | |
if (getView() != null) { | |
getView().showErrorDialog("You shall not pass!"); | |
} | |
} | |
} else { | |
if (getView() != null) { | |
getView().showErrorDialog(throwable.getMessage()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment