Unable to parse error in Retrofit 2
问题 I am using Retrofit 2 and I am getting a null pointer exception at this line: RetrofitClient.APIError error = RetrofitClient.ErrorUtils.parseError(response, retrofit); The error is null. More details: This is the format that the API returns the error in: { "error": { "message": "Incorrect credentials", "statusCode": 401 } } Here is my login Callback code: new Callback<LoginResponse>() { @Override public void onResponse(Response<LoginResponse> response, Retrofit retrofit) { if (listener !=