File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
sdk/src/main/kotlin/io/opentdf/platform/sdk Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -7,9 +7,11 @@ import com.connectrpc.getOrThrow
77class RequestHelper {
88 companion object {
99 /* *
10- * Kotlin doesn't have checked exceptions so that if we want to catch
11- * an exception thrown by Kotlin we need to declare that the method throws it.
12- * ResponseMessageKt.getOrThrow() doesn't do so; so we need to wrap it
10+ * Kotlin doesn't have checked exceptions (importantly it doesn't declare them).
11+ * This means that if a Kotlin function throws a checked exception, you can't
12+ * catch it in Java unless it uses the {@class kotlin.jvm.Throws} annotation.
13+ * We wrap the getOrThrow() method in a static method with the annotation we
14+ * need to catch a {@class ConnectException} in Java.
1315 */
1416 @JvmStatic @Throws(ConnectException ::class )
1517 fun <T > getOrThrow (responseMessage : ResponseMessage <T >): T {
You can’t perform that action at this time.
0 commit comments