Does Ktor always throw a subclass of `RuntimeExcep...
# ktor
o
Does Ktor always throw a subclass of
RuntimeException
? Edit: nope, just found the
BadContentTypeException : Exception
.
try { client.request() } catch(e: Exception)
it is then.
c
What did such impression first? Why did you think so?
c
Well, in Kotlin there is no big difference between Exception and RuntimeException, so there is no reason to make them all runtime exceptions
o
Originally I was looking for a way to catch everything that could be expected to throw from
HttpClient.request
without resorting to
catch(e: Exception)
. But that catches also the unexpected stuff. Like on the JVM I'd catch
IOException
from an IO framework.