Fixed ErrorContext of some errors being omitted

This commit is contained in:
Risto Lahtela 2021-01-23 21:53:07 +02:00
parent 46e486e00c
commit 5fae224ef6

View File

@ -94,7 +94,7 @@ public class PluginErrorLogger implements ErrorLogger {
} }
private void mergeAdditionalContext(Throwable throwable, ErrorContext context) { private void mergeAdditionalContext(Throwable throwable, ErrorContext context) {
Throwable cause = throwable.getCause(); Throwable cause = throwable;
while (cause != null) { while (cause != null) {
if (cause instanceof ExceptionWithContext) { if (cause instanceof ExceptionWithContext) {
((ExceptionWithContext) cause).getContext().ifPresent(context::merge); ((ExceptionWithContext) cause).getContext().ifPresent(context::merge);