So for some reason I need to execute my call like this:
val result = manager.call.execute()
if (result.isSuccess) {
//do stuff
} else {
//handle exeption
}
When my code arrives in the else
bracket result.body()
is null and result.errorBody()
has its buffer content to 0 but not its length.
BUT, this are the log I get from retrofit :
<-- 400 Bad Request https://cubus-friends-
...
D/OkHttp: {"error":"validation_error","error_description":"No user with that phone number"}
D/OkHttp: <-- END HTTP (81-byte body)
How can I get my json error string into the else
bracket in my code ?