Hi there, I am using Ktor 1.5.0 combined with platform specific httpclients (OkHttp & Ios).
I have setup the HttpResponseValidator although whenever I receive an http error like 401, instead of catching a custom throwable I made for this case, I am always getting a NoTransformationFoundException.
Have you encountered anything similar?
, then I receive a ClientRequestException.
Finally I can extract the Http status like this and perform any further actions:
Copy code
val httpStatus = (error as? ResponseException)?.getHttpStatus() ?: 200
fun ResponseException.getHttpStatus(): Int {
return response.status.value
}
I must say though that the response validator seems a really handy tool I we are awaiting for its issue to be fixed.
m
MBegemot
03/20/2021, 8:53 PM
I totally agree
MBegemot
03/20/2021, 9:23 PM
amazing I got it right by setting expectSuccess=false .... But the issue is clear we send crap to de server and we want to get crap from the server ..... that's it. But we want to know ... what crap is it.