mirror of
https://github.com/corda/corda.git
synced 2024-12-20 05:28:21 +00:00
fixed bug in error reporting (#6127)
the current code doesn't forward the exception to the logging system, this means that any cause inside the exception is lost as with all of the stacktraces (both the one of the thrown exception and the one belonging to its cause). The correct way to log an exception is to pass both the message and the exception to the logging system.
This commit is contained in:
parent
1d7c13276c
commit
42211a6d45
@ -98,11 +98,12 @@ class NodeLifecycleEventsDistributor : Closeable {
|
||||
orderedSnapshot.forEach {
|
||||
log.debug("Distributing event $event to: $it")
|
||||
val updateResult = it.update(event)
|
||||
if (updateResult.isSuccess) {
|
||||
log.debug("Event $event distribution outcome: $updateResult")
|
||||
} else {
|
||||
log.error("Failed to distribute event $event, failure outcome: $updateResult")
|
||||
handlePossibleFatalTermination(event, updateResult as Try.Failure<String>)
|
||||
when(updateResult) {
|
||||
is Try.Success -> log.debug("Event $event distribution outcome: $updateResult")
|
||||
is Try.Failure -> {
|
||||
log.error("Failed to distribute event $event, failure outcome: $updateResult", updateResult.exception)
|
||||
handlePossibleFatalTermination(event, updateResult)
|
||||
}
|
||||
}
|
||||
}
|
||||
result.set(null)
|
||||
|
Loading…
Reference in New Issue
Block a user