Guest User

Untitled

a guest
Oct 15th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. public void handleError(Throwable e) {
  2. String errorMessage;
  3.  
  4. Log.w(TAG, e);
  5.  
  6. try {
  7. throw e;
  8. } catch (JetTaxiException je) {
  9. errorMessage = e.getLocalizedMessage();
  10.  
  11. if (je.getStatusCode() == HttpStatus.SC_UNAUTHORIZED) {
  12. logout();
  13. }
  14. } catch (IOException io) {
  15. errorMessage = getString(R.string.network_error);
  16. } catch (Throwable throwable) {
  17. errorMessage = getString(R.string.unknown_error);
  18. BugSenseHandler.log(TAG, (Exception) throwable);
  19. }
  20.  
  21.  
  22. if (isActive()) {
  23. Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show();
  24. }
  25. }
Add Comment
Please, Sign In to add comment