Skip to content

Commit

Permalink
Added better error handling capabilities.
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewReitz committed Dec 2, 2014
1 parent 11a0ed9 commit dadb706
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,16 @@ public abstract class RetrofitObserver<T> implements Observer<T> {
if (e instanceof RetrofitError) {
this.onError((RetrofitError) e);
} else {
throw new RuntimeException("Error other than retrofit error. "
+ "You should override onError(Throwable e) to handle this", e);
nonRetrofitError(e);
}
onEnd();
}

public void nonRetrofitError(Throwable e) {
throw new RuntimeException("Error other than retrofit error. "
+ "You should override nonRetrofitError(Throwable e) to handle this", e);
}

/**
* Override to get notified from onComplete or onError. Be sure to call through to super on
* overridden {@link #onError(Throwable)} or {@link #onCompleted()}.
Expand Down

0 comments on commit dadb706

Please sign in to comment.