Fixed issue with meaningless stack trace for suspending methods
This commit is contained in:
parent
39503ac6d9
commit
1750e0a2b0
|
@ -260,9 +260,9 @@ internal class RmiClient(val isGlobal: Boolean,
|
||||||
continuation.resumeWithException(exception)
|
continuation.resumeWithException(exception)
|
||||||
}
|
}
|
||||||
is Exception -> {
|
is Exception -> {
|
||||||
// reconstruct the stack trace, so the calling method knows where the method invocation happened, and can trace the call
|
// for co-routines, it's impossible to get a legit stacktrace without impacting general performance,
|
||||||
// this stack will ALWAYS run up to this method (so we remove from the top->down, to get to the call site)
|
// so we just don't do it.
|
||||||
RmiUtils.cleanStackTraceForProxy(Exception(), any)
|
// RmiUtils.cleanStackTraceForProxy(Exception(), any)
|
||||||
continuation.resumeWithException(any)
|
continuation.resumeWithException(any)
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
|
|
|
@ -398,12 +398,7 @@ internal class RmiManagerGlobal<CONNECTION : Connection>(logger: KLogger,
|
||||||
suspendResult = null
|
suspendResult = null
|
||||||
} else if (suspendResult is Exception) {
|
} else if (suspendResult is Exception) {
|
||||||
RmiUtils.cleanStackTraceForImpl(suspendResult, true)
|
RmiUtils.cleanStackTraceForImpl(suspendResult, true)
|
||||||
|
endPoint.listenerManager.notifyError(connection, suspendResult)
|
||||||
val fancyName = RmiUtils.makeFancyMethodName(cachedMethod)
|
|
||||||
val exception = Exception("Error invoking method: $fancyName", suspendResult)
|
|
||||||
RmiUtils.cleanStackTraceForImpl(exception, true)
|
|
||||||
|
|
||||||
endPoint.listenerManager.notifyError(connection, exception)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sendResponse) {
|
if (sendResponse) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user