Skip to content

Commit 8aab1d9

Browse files
committed
Provide inner/cause exceptions
1 parent 76a232b commit 8aab1d9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

adapter/src/main/kotlin/org/javacs/ktda/jdi/exception/JDIException.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ class JDIException(
2525
?.let { exception.invokeMethod(thread, it, emptyList(), 0) }
2626
?.toString()
2727
}
28+
override val innerException: JDIException? by lazy {
29+
type.methodsByName("getCause")
30+
.firstOrNull()
31+
?.let { exception.invokeMethod(thread, it, emptyList(), 0)?.let { it as? ObjectReference } }
32+
?.let { JDIException(it, thread) }
33+
}
2834

29-
// TODO: Stack frames, inner exception
35+
// TODO: Stack frames
3036
}

0 commit comments

Comments
 (0)