deltaspike-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maik Ebert (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DELTASPIKE-358) ExceptionHandler should call exception hierarchies bottom up
Date Mon, 29 Apr 2013 15:52:16 GMT

     [ https://issues.apache.org/jira/browse/DELTASPIKE-358?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Maik Ebert updated DELTASPIKE-358:
----------------------------------

    Description: 
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}
public class AccessDeniedException extends RuntimeException {
}

@ExceptionHandler
public class AdminWebExceptionHandler {
	public void handleAccessDeniedException(@Handles @FacesRequest ExceptionEvent<AccessDeniedException>
exceptionEvent, FacesContext facesContext) {
}
	public void handleRuntimeException(@Handles @FacesRequest ExceptionEvent<RuntimeException>
exceptionEvent, FacesContext facesContext) {
}
}
{code}

In that case handleRuntimeException() is called.
I would except to have handleAccessDeniedException() called instead.


  was:
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}
public class AccessDeniedException extends RuntimeException {
}

@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.


    
> ExceptionHandler should call exception hierarchies bottom up
> ------------------------------------------------------------
>
>                 Key: DELTASPIKE-358
>                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-358
>             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}
> public class AccessDeniedException extends RuntimeException {
> }
> @ExceptionHandler
> public class AdminWebExceptionHandler {
> 	public void handleAccessDeniedException(@Handles @FacesRequest ExceptionEvent<AccessDeniedException>
exceptionEvent, FacesContext facesContext) {
> }
> 	public void handleRuntimeException(@Handles @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

Mime
View raw message