[seam-issues] [JBoss JIRA] (SOLDER-290) Rethrown checked exception should not be wrapped within ObserverException

Jozef Hartinger (Created) (JIRA) jira-events at lists.jboss.org
Thu Oct 13 11:10:16 EDT 2011


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: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the seam-issues mailing list