Details
-
Type:
Bug
-
Status: Resolved (View Workflow)
-
Priority:
Major
-
Resolution: Done
-
Affects Version/s: 3.1.0.Beta3
-
Fix Version/s: 3.1.0.Beta4
-
Component/s: Exception Handling
-
Labels:None
-
Affects:Release Notes
Description
The spec says:
Otherwise, the exception aborts processing of the event. No other observer methods of that event will be called. The
BeanManager.fireEvent() or Event.fire() method rethrows the exception. If the exception is a checked exception,
it is wrapped and rethrown as an (unchecked) ObserverException.
Therefore, everytime an exception handler marks the exception to be rethrown, ExceptionHandlerDispatch.executeHandlers() rethrows the exception. If the exception is checked, the CDI implementation must wrap the exception within ObserverException. As a result, the exception is rethrown within the ObserverException wrapper.
Everytime we notify the dispatcher using via the ExceptionToCatch event bm.fireEvent(new ExceptionToCatch(e)), we should check if the call raises an exception and if it does raises ObserverException, we should unwrap it.
This should be also documented for other integrators to do the same thing.
Gliffy Diagrams
Activity
- All
- Comments
- Work Log
- History
- Activity
- Links Hierarchy
Added test org.jboss.solder.exception.control.test.common.interceptor.ExceptionHandledInterceptorTest.testExceptionRethrownWhenNoExceptionHandlerAvailable()