Daniele Segato
12/05/2024, 8:01 AMtypealias 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
try {
// ...
} catch(e: NetworkError) {
}
I get this error:
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, cheersDaniele Segato
12/05/2024, 8:07 AMinterface 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 dependencyDaniele Segato
12/05/2024, 8:15 AM