Hello; I’m trying to get uniform exception handlin...
# multiplatform
i
Hello; I’m trying to get uniform exception handling across jvm, native and JS. I tried @Throws, and I get
Unresolved reference: Throws
in javascript compilation I used the following trick to work around it:
Copy code
commonMain:
   expect annotation class MyThrows(vararg val exceptionClasses:KClass<out Throwable>);
jsMain:
   actual annotation class MyThrows(
     actual vararg val exceptionClasses:KClass<out Throwable>
   ) {}
jvmMain:
   actual typealias MyThrows = kotlin.jvm.Throws
elsewhere:
   actual typealias MyThrows = kotlin.native.Throws
… so I’m not blocked but am I missing something?