Answer the question
In order to leave comments, you need to log in
How to make a centralized error handler in Retrofit 2?
Google, and the documentation itself on the second retrofit, basically. offers to catch errors by response.isSuccessful() in onResponse in case of errors by HTTP response codes and check for exceptions in onFailure. Yes, it seems to be understandable, but there are 100500+ requests and the idea of how to do such checks in each of them gives up. Tell me, if the method of a centralized error handler, as in the case of HTTP codes, and with a network error, etc.? HTTP client OkHttpClient.
Thanks a lot.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question