]
Jozef Hartinger commented on SOLDER-290:
----------------------------------------
Added test
org.jboss.solder.exception.control.test.common.interceptor.ExceptionHandledInterceptorTest.testExceptionRethrownWhenNoExceptionHandlerAvailable()
Rethrown checked exception should not be wrapped within
ObserverException
-------------------------------------------------------------------------
Key: SOLDER-290
URL:
https://issues.jboss.org/browse/SOLDER-290
Project: Seam Solder
Issue Type: Bug
Components: Exception Handling
Affects Versions: 3.1.0.Beta3
Reporter: Jozef Hartinger
Fix For: 3.1.0.CR1
The spec says:
{quote}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.{quote}
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.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: