I was caught off guard by `HttpClient.submitForm` ...
# ktor
m
I was caught off guard by
HttpClient.submitForm
throwing an
UnresolvedAddressException
, I thought it wraps all errors in the returned HttpResponse, and the doc comment for it doesn't say it throws any exceptions. Is this documented anywhere? I.e. how do I know what other exceptions can I potentially expect? I have some generic handling for `IOException`s but
UnresolvedAddressException
isn't one so it just crashed my app. I don't want to catch
Exception
because that would interfere with coroutines cancellation.
a
I think It doesn't documented because of the assumption that exceptions is the default mechanism for error handling in Java and Kotlin. The exceptions may be different depending on the platform and the engine and, unfortunately, the list of all potential exceptions isn't documented. There is a feature request to make a single unified exception type.