I need to test something related to the NetworkErr...
# multiplatform
s
I need to test something related to the NetworkError (Includes airplane mode) , but while catching the exception I am getting java.net.UnknownHostException. Can someone just tell me why are we not throwing IO and if not what can we do to check the no internet connection. In below code it going to the else condition , is the UnknownHostException only used in the no internet connection?
Copy code
suspend fun <Success> httpCallV3(job: suspend () -> Success): Success =
  try {
    job.invoke()
  } catch (e: Exception) {
    when (e) {
      is DomainException -> throw e.cause
      is ParsingException,
      is ServerException,
      is UnauthorizedException,
      is UnknownException -> throw e
      is IOException -> throw NetworkException(e)
      else -> throw UnknownException(e)
    }
  }