I'm trying to get error message, but have a problem with it. I see it on debugger, but can't get access in code.
Found resolution, may be for somebody could be helpfully:
val errorJsonString: String? = (error as? HttpException)?.response()?.errorBody()?.string()
errorJsonString?.let {
val parsedString: JsonElement = JsonParser().parse(it)
val e: ErrorResponse = Gson().fromJson(parsedString, ErrorResponse::class.java)
callback(result, error, e)
} ?: callback(result, error, null)