Answers for "how to handle errors while api call"

0

how to handle errors while api call

val gson = Gson()
val type = object : TypeToken<ErrorResponse>() {}.type
var errorResponse: ErrorResponse? = gson.fromJson(response.errorBody()!!.charStream(), type)
Posted by: Guest on June-25-2021

Browse Popular Code Answers by Language