I am getting this error in my logs:
Caused by java.lang.ClassCastException: java.net.UnknownHostException cannot be cast to retrofit2.adapter.rxjava.HttpException
and thats my onError method. The error is probably caused when the device has no connection.
@Override
public void onError(Throwable e) {
assert e != null;
Timber.d(e);
HttpException exception = (HttpException) e;
assert view != null;
view.hideRefreshSpinner();
if (exception.code() == HttpURLConnection.HTTP_BAD_REQUEST) {
view.showSnackbarInvalidError();
} else {
view.showUnauthorizedError();
}
}