user3186731 user3186731 - 3 months ago 26
Android Question

The Best Way to Debug Retrofit Error Messages

I'm new to Retrofit. I have used Volley, and I kind of like Retrofit. I was just about to select Retrofit when I ran into this very non-descriptive error message when trying to do a POST.

Exception in thread "main" retrofit.RetrofitError
at retrofit.RetrofitError.httpError(
at retrofit.RestAdapter$RestHandler.invokeRequest(
at retrofit.RestAdapter$RestHandler.invoke(
at myapi.api.$Proxy7.logon(Unknown Source)
at myapi.api.TestDriver.main(

Well, I must say that this type of error message is about as useful as a warm jacket in the Sahara.

Does anyone even know where to begin with debugging this type of message? I really am not about to delegate to a REST api that does not provide useful error messages.


You probably want to add a catch clause to TestDriver.main:

try {
} catch (RetrofitError e) {