[
https://issues.apache.org/jira/browse/MYFACES-2796?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12886297#action_12886297
]
Jakob Korherr commented on MYFACES-2796:
----------------------------------------
created spec issue #864:
https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=864
> org/apache/myfaces/shared/context/ExceptionHandlerImpl.java #
> getRootCause(Throwalbe) not work correctly
> --------------------------------------------------------------------------------------------------------
>
> Key: MYFACES-2796
> URL: https://issues.apache.org/jira/browse/MYFACES-2796
> Project: MyFaces Core
> Issue Type: Bug
> Components: JSR-314
> Affects Versions: 2.0.0
> Reporter: Gurkan Erdogdu
> Assignee: Jakob Korherr
>
> I throw exception from my EL method and handling exceptions with my custom
> exception handler.
> //Exception class
> public class MyException extends RuntimeException{
> }
> //Bean action method
> //Using from #{bean.log} in a page
> public String log(){
> if(ok){
> throw new MyException();
> }
> }
> I write custom exception handler with wrapped semantic.
> public class MyExceptionHandler extends ExceptionHandlerWrapper{
> public void handle(){
> .....................
> ExceptionQueuedEvent event = i.next();
> ExceptionQueuedEventContext context =
> (ExceptionQueuedEventContext) event
> .getSource();
> Throwable t = context.getException();
> Throeable cause = getRootCause(t); --> But it does
> not give MyException, it gives ELEvaluationException!!!!
> ...............
> }
> }
> Probiem is that
> http://svn.apache.org/repos/asf/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/context/ExceptionHandlerImpl.java
> # getRootCause compare classes with equals(), but must use
> isAssignableFrom().
>
> //Current Implementation
> if (!clazz.equals(FacesException.class) &&
> !clazz.equals(ELException.class))
> {
> return t;
> }
>
> //I think it must be
> if(!FacesException.isAssignableFrom(clazz) &&
> !ELException.isAssignableFrom(clazz)){
> return t;
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.