Debugger: Unwrap EvaluateExceptions on checking (EA-105847)

This commit is contained in:
Yan Zhulanow
2019-07-23 21:19:52 +09:00
parent e301ddde9e
commit a664df8143
@@ -39,15 +39,22 @@ class KotlinCoroutinesAsyncStackTraceProvider : KotlinCoroutinesAsyncStackTraceP
override fun getAsyncStackTrace(stackFrame: JavaStackFrame, suspendContext: SuspendContextImpl): List<StackFrameItem>? { override fun getAsyncStackTrace(stackFrame: JavaStackFrame, suspendContext: SuspendContextImpl): List<StackFrameItem>? {
return try { return try {
getAsyncStackTraceSafe(stackFrame.stackFrameProxy, suspendContext) getAsyncStackTraceSafe(stackFrame.stackFrameProxy, suspendContext)
} catch (e: ObjectCollectedException) { } catch (e: Exception) {
handleException(e)
null null
} catch (e: IncompatibleThreadStateException) { }
null }
} catch (e: VMDisconnectedException) {
null private fun handleException(e: Exception) {
} catch (e: EvaluateException) { when (if (e is EvaluateException) e.cause ?: e else e) {
is ObjectCollectedException, is IncompatibleThreadStateException, is VMDisconnectedException -> {}
else -> {
if (e is EvaluateException) {
LOG.debug("Cannot evaluate async stack trace", e) LOG.debug("Cannot evaluate async stack trace", e)
null } else {
throw e
}
}
} }
} }