ΠΠ°ΠΊ ΠΏΠ°ΡΡΠΈΡΡ ΠΎΡΠΈΠ±ΠΊΠΈ Π² ΠΎΡΠ²Π΅ΡΠ΅ (4xx, 5xx)
val authApi = ControllerApi().getAuthApi() val refreshTokenReq = authApi.register(user) refreshTokenReq.enqueue(object : Callback<...>) { override fun onResponse(call: ..., response: ...) { if (response.isSuccessful) { ... } else { val gson = Gson() val type = object : TypeToken<MyErrorData>(){}.type val myErrorBody: MyErrorData? = gson.fromJson(response.errorBody()!!.charStream(), type) } } }
Last updated 4 years ago
Was this helpful?