struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject svn commit: r1396976 - /struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java
Date Thu, 11 Oct 2012 10:25:36 GMT
Author: lukaszlenart
Date: Thu Oct 11 10:25:36 2012
New Revision: 1396976

URL: http://svn.apache.org/viewvc?rev=1396976&view=rev
Log:
WW-3609 adds more logging when exception occurred

Modified:
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java?rev=1396976&r1=1396975&r2=1396976&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java
(original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java
Thu Oct 11 10:25:36 2012
@@ -817,6 +817,9 @@ public class Dispatcher {
     public void sendError(HttpServletRequest request, HttpServletResponse response, ServletContext
ctx, int code, Exception e) {
         Boolean devModeOverride = FilterDispatcher.getDevModeOverride();
         if (devModeOverride != null ? devModeOverride : devMode) {
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Exception occurred during processing request: #0", e, e.getMessage());
+            }
             response.setContentType("text/html");
 
             try {
@@ -841,6 +844,9 @@ public class Dispatcher {
                 response.getWriter().close();
             } catch (Exception exp) {
                 try {
+                    if (LOG.isDebugEnabled()) {
+                        LOG.debug("Cannot show problem report!", exp);
+                    }
                     response.sendError(code, "Unable to show problem report: " + exp);
                 } catch (IOException ex) {
                     // we're already sending an error, not much else we can do if more stuff
breaks
@@ -848,6 +854,9 @@ public class Dispatcher {
             }
         } else {
             try {
+                if (LOG.isErrorEnabled()) {
+                    LOG.error("Exception occurred during processing request: #0", e, e.getMessage());
+                }
                 // WW-1977: Only put errors in the request when code is a 500 error
                 if (code == HttpServletResponse.SC_INTERNAL_SERVER_ERROR) {
                     // send a http error response to use the servlet defined error handler



Mime
View raw message