[seam-issues] [JBoss JIRA] Commented: (SEAMFACES-90) Exceptions thrown within a Seam Catch handler are swallowed by Faces

Brian Leathem (JIRA) jira-events at lists.jboss.org
Fri Feb 25 00:54:05 EST 2011


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

Brian Leathem commented on SEAMFACES-90:
----------------------------------------

Post mortem:
I tried publishing the exception into the JSF exception handling mechanism with:
} catch (Exception e) {
   FacesContext ctx = FacesContext.getCurrentInstance();
   ExceptionQueuedEventContext eventContext = new ExceptionQueuedEventContext(ctx, e);
   eventContext.getAttributes().put("key", "value");
   ctx.getApplication().publishEvent(ctx, ExceptionQueuedEvent.class, eventContext);
 }
(from: http://download.oracle.com/docs/cd/E17802_01/j2ee/javaee/javaserverfaces/2.0/docs/api/javax/faces/context/ExceptionHandler.html)

But this resulted in a ConcurrentModificationException

So I ended up simply throwing the exception as a new RuntimeException

> Exceptions thrown within a Seam Catch handler are swallowed by Faces
> --------------------------------------------------------------------
>
>                 Key: SEAMFACES-90
>                 URL: https://issues.jboss.org/browse/SEAMFACES-90
>             Project: Seam Faces
>          Issue Type: Bug
>          Components: Exception Handling
>    Affects Versions: 3.0.0.CR1
>            Reporter: Brian Leathem
>            Assignee: Brian Leathem
>             Fix For: 3.0.0.Final
>
>
> The fix in SEAMFACES-87 allows exceptions re-thrown by catch to be dealt with by the JSF exception handling mechanism.  However, the fix for SEAMFACES-87 also swallows new exceptions generated within catch (for instance an NPE originating in the Catch handler).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the seam-issues mailing list