[weld-issues] [JBoss JIRA] (WELD-894) Around-Invoke interceptors should not wrap RuntimeException into WeldException

Marko Lukša (JIRA) jira-events at lists.jboss.org
Mon Mar 5 09:47:36 EST 2012


    [ https://issues.jboss.org/browse/WELD-894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12673605#comment-12673605 ] 

Marko Lukša commented on WELD-894:
----------------------------------

{{InterceptorImpl.intercept()}} is actually never called. Interceptor methods are called directly and both checked and unchecked exceptions are delivered to the caller unchanged (not wrapped).

Nevertheless, I changed {{InterceptorImpl.intercept()}} as requested - unchecked exceptions are now rethrown without wrapping them into WeldException. Checked exceptions are of course still wrapped, because {{Interceptor.intercept()}} does not throw any exceptions according to the CDI 1.0 spec (this is fixed in CDI 1.1).

Pull req: https://github.com/weld/core/pull/167
                
> Around-Invoke interceptors should not wrap RuntimeException into WeldException
> ------------------------------------------------------------------------------
>
>                 Key: WELD-894
>                 URL: https://issues.jboss.org/browse/WELD-894
>             Project: Weld
>          Issue Type: Feature Request
>          Components: Interceptors and Decorators
>    Affects Versions: 1.1.1.Final
>            Reporter: Vlastimil Menčík
>            Assignee: Marko Lukša
>              Labels: EJB, interceptors, weld
>
> Currently, org.jboss.weld.bean.InterceptorImpl always throws a WeldException when the invoked method throws an exception.
> This causes all exceptions in intercepted session bean methods to be treated as system exceptions by the EJB subsystem as WeldException is a system exception.
> If RuntimeExceptions were simply rethrown, such exceptions (annotated with javax.ejb.ApplicationException) could pass through the interceptor unwrapped and be recognized as application exception in the EJB sense.
> Of course, checked application exceptions are a bigger problem that would probably require a more sofisticated solution, that could be resolved later.

--
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 weld-issues mailing list