[jboss-cvs] jboss-seam/src/main/org/jboss/seam/core ...
Gavin King
gavin.king at jboss.com
Fri Oct 27 17:54:09 EDT 2006
User: gavin
Date: 06/10/27 17:54:09
Modified: src/main/org/jboss/seam/core Exceptions.java
Log:
fixed bad bug JBSEAM-445
Revision Changes Path
1.5 +11 -9 jboss-seam/src/main/org/jboss/seam/core/Exceptions.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Exceptions.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/core/Exceptions.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- Exceptions.java 27 Oct 2006 13:54:23 -0000 1.4
+++ Exceptions.java 27 Oct 2006 21:54:09 -0000 1.5
@@ -47,17 +47,16 @@
private List<ExceptionHandler> exceptionHandlers = new ArrayList<ExceptionHandler>();
- public ExceptionHandler handle(Exception e) throws Exception
+ public Object handle(Exception e) throws Exception
{
for (ExceptionHandler eh: exceptionHandlers)
{
if ( eh.isHandler(e) )
{
- eh.handle(e);
- break;
+ return eh.handle(e);
}
}
- return null;
+ throw e;
}
@Create
@@ -203,13 +202,13 @@
public static interface ExceptionHandler
{
- public void handle(Exception e) throws Exception;
+ public Object handle(Exception e) throws Exception;
public boolean isHandler(Exception e);
}
public static class RedirectHandler implements ExceptionHandler
{
- public void handle(Exception e) throws Exception
+ public Object handle(Exception e) throws Exception
{
addFacesMessage( e, getMessage(e) );
if ( isEnd(e) ) Conversation.instance().end();
@@ -242,11 +241,12 @@
public static class RenderHandler implements ExceptionHandler
{
- public void handle(Exception e)
+ public Object handle(Exception e)
{
addFacesMessage( e, getMessage(e) );
if ( isEnd(e) ) Conversation.instance().end();
render( getViewId(e) );
+ return null;
}
public boolean isHandler(Exception e)
@@ -273,13 +273,14 @@
public static class ErrorHandler implements ExceptionHandler
{
- public void handle(Exception e) throws Exception
+ public Object handle(Exception e) throws Exception
{
if ( isEnd(e) ) Conversation.instance().end();
String message = getMessage(e);
addFacesMessage(e, message);
error( getCode(e), Interpolator.instance().interpolate( getDisplayMessage(e, message) ) );
handled(e);
+ throw e;
}
public boolean isHandler(Exception e)
@@ -306,7 +307,7 @@
public static class DebugPageHandler implements ExceptionHandler
{
- public void handle(Exception e)
+ public Object handle(Exception e) throws Exception
{
log.error("redirecting to debug page", e);
Contexts.getConversationContext().set("org.jboss.seam.debug.lastException", e);
@@ -321,6 +322,7 @@
FacesMessages.afterPhase();
AbstractSeamPhaseListener.storeAnyConversationContext(facesContext);
handled(e);
+ throw e;
}
public boolean isHandler(Exception e)
More information about the jboss-cvs-commits
mailing list