```typealias NetworkError = kotlinx.io.IOException...
# multiplatform
d
Copy code
typealias NetworkError = kotlinx.io.IOException
with a multiplatform project apparently typealiasing an expected exception doesn’t really work If I do the above and than try to
Copy code
try {
  // ...
} catch(e: NetworkError) {
}
I get this error:
Copy code
Throwable type mismatch: actual type is 'kotlinx.io.IOException'.
It isn’t a big deal, I can use
kotlinx.io.IOException
directly, I just wanted to ask if this is an intentional limitation or if there’s something going on here, cheers
I should probably mention that this error isn’t always showing up.. This is what I have, 3 modules: • shared:network • shared:api • shared:usage so in the network module I defined the typealias the api module declare an API like this:
Copy code
interface MyApi {

  @Throws(NetworkError::class, CancellationException::class)
  suspend foo()
}
finally the usage module call the
MyApi
and try to catch
NetworkError
. Both the api and the usage module have the network module as dependency
The only reason I wanted the typealias is that I wanted my network library to be part of the API instead of the kotlinx-io library