With HttpResponseValidator fun <T : HttpClientEn...
# multiplatform
k
With HttpResponseValidator fun T : HttpClientEngineConfig HttpClientConfigT.exceptionHandling() { HttpResponseValidator { handleResponseExceptionWithRequest { exception, _ -> val type = when (exception) { is ClientRequestException -> RemoteExceptionType.CLIENT_ERROR is ServerResponseException -> RemoteExceptionType.SERVER_ERROR is JsonConvertException -> RemoteExceptionType.PARSING_ERROR else -> RemoteExceptionType.UNKNOWN } throw RemoteException(type) } }
h
unknown host exception is not possible to catch with this.
k
Then you can always wrap your request block with run catching