You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltaspike.apache.org by "Jason Porter (JIRA)" <ji...@apache.org> on 2013/04/30 06:56:15 UTC

[jira] [Commented] (DELTASPIKE-357) ExceptionHandler should call exception hierarchies bottom up

    [ https://issues.apache.org/jira/browse/DELTASPIKE-357?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13645245#comment-13645245 ] 

Jason Porter commented on DELTASPIKE-357:
-----------------------------------------

The first problem with the code you listed is that AccessDeniedException does not inherit from RuntimeException (http://docs.oracle.com/javase/7/docs/api/java/nio/file/AccessDeniedException.html).  I don't know where or under which circumstances you're sending the event to the Exception Handling code, but my guess is that it's happening from multiple locations.

This issue is tested in https://github.com/apache/incubator-deltaspike/blob/master/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/exception/control/traversal/TraversalPathTest.java (using the classes within the same package)
                
> ExceptionHandler should call exception hierarchies bottom up
> ------------------------------------------------------------
>
>                 Key: DELTASPIKE-357
>                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-357
>             Project: DeltaSpike
>          Issue Type: Bug
>          Components: ExceptionControl-Module
>    Affects Versions: 0.3-incubating
>            Reporter: Maik Ebert
>
> I would assume that when you have an exception hierarchy DeltaSpike would call handlers for the sub class before it call handlers for the super class.
> But that's not the case.
> Assume you have:
> {code}
> @ExceptionHandler
> public class AdminWebExceptionHandler {
> 	public void handleAccessDeniedException(@Handles @FacesRequest ExceptionEvent<AccessDeniedException> exceptionEvent, FacesContext facesContext) {
> }
> 	public void handleRuntimeException(@Handles(ordinal = -1) @FacesRequest ExceptionEvent<RuntimeException> exceptionEvent, FacesContext facesContext) {
> }
> }
> {code}
> In that case handleRuntimeException() is called.
> I would except to have handleAccessDeniedException() called instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira