Is there a way to check does a domain exist or cat...
# ktor
r
Is there a way to check does a domain exist or catch error related to the domain not existing in ktor?
a
Do you mean to determine if a host name could be resolved?
r
Yes
a
The simplest way is to make a request and catch one of the exceptions thrown due to of the host name resolution error, for example,
UnresolvedAddressException
or
UnknownHostException
. The actual exception type depends on the client engine and the platform.
r
What exception is used on the JVM?
a
For example,
UnresolvedAddressException
or
UnknownHostException
. You can make a request to non-existent host to see what type exception is thrown.
r
Thanks for the answer