deltaspike-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Biertho" <>
Subject Exception handling loss of the root cause.
Date Wed, 22 Feb 2017 10:04:47 GMT

There is a strange behaviour in the exception handling...

Looking the org.apache.deltaspike.core.api.exception.control.event.
ExceptionStackEvent.init() line 96
current = exceptionStackItems.removeFirst().getThrowable();
This removes the first original exception when handling exception events...

Then when throwing this anywhere:
throw new RuntimeException("RootCause", new RuntimeException("previous

or in a normal catch block
} catch (final Exception ex) {
            throw new CustomException("previous cause",ex);

A method with a param @Handles final ExceptionEvent<Exception> evt
will give the "previous cause" exception... not the RootCause when evt
.getException(); is called

This behaviour and loss of information is really anoying ...
Is this a wanted or a bug ?

Vincent Biertho
Java Team ONEm/RVA

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message