Uploaded image for project: 'Seam Faces'
  1. Seam Faces
  2. SEAMFACES-90

Exceptions thrown within a Seam Catch handler are swallowed by Faces

    Details

      Description

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

        Gliffy Diagrams

          Activity

          Hide
          bleathem Brian Leathem added a comment -

          It should be trivial to compare the exception thrown within catch to the exception handled by catch, to see if it's a new exception.

          Ideally this new exception would be dealt with by the JSF exception handling mechanism. Or at least have the new exception logged, and let JSF deal with the original exception.

          Show
          bleathem Brian Leathem added a comment - It should be trivial to compare the exception thrown within catch to the exception handled by catch, to see if it's a new exception. Ideally this new exception would be dealt with by the JSF exception handling mechanism. Or at least have the new exception logged, and let JSF deal with the original exception.
          Show
          bleathem Brian Leathem added a comment - https://github.com/seam/faces/commit/b858e6f82123f2f009fd8cd1db5e372008c4738f
          Hide
          bleathem Brian Leathem added a comment -

          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

          Show
          bleathem Brian Leathem added a comment - 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

            People

            • Assignee:
              bleathem Brian Leathem
              Reporter:
              bleathem Brian Leathem
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development