diff --git a/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/security/MDCHandler.java b/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/security/MDCHandler.java index 6037ddbaaa..fd9de1c371 100644 --- a/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/security/MDCHandler.java +++ b/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/security/MDCHandler.java @@ -125,12 +125,10 @@ private T putUserAndCall(final Callable callable) throws WrappedException put(MDC_KEY_USER, currentUser); } } + } catch (final RuntimeException e) { + throw e; } catch (final Exception e) { - if (e instanceof RuntimeException) { - throw (RuntimeException) e; - } else { - throw new WrappedException(e); - } + throw new WrappedException(e); } }