https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
n

Nikky

03/26/2022, 8:29 PM
how do you catch a
java.net.ConnectException
in common code? i cannot define a
expect class ConnectException: Exception
because that extends
kotlin.Exception
and not the java exception type.. and without that i cannot catch it.. event
catch)e: Throwable)
in common code does not catch it
b

Big Chungus

03/26/2022, 8:58 PM
Isn't kotlin.Exception a typealias to java Exception on jvm?
a

andylamax

03/27/2022, 5:22 AM
actually
kotlin.Exception
is a typealias to java
Exception
when targeting jvm. So, your
expect/actual
should just work
👆 1
33 Views