diff options
author | Greg Wilkins | 2013-09-05 01:04:11 +0000 |
---|---|---|
committer | Greg Wilkins | 2013-09-05 01:04:11 +0000 |
commit | 9b9c7ba8d11a120a92f679a1648f925441a18bba (patch) | |
tree | cb8905628d5be5368308a1ef9eeee1ec018f9d25 | |
parent | 78c322af8e10eab20b79ac2b3745d394d1564498 (diff) | |
download | org.eclipse.jetty.project-9b9c7ba8d11a120a92f679a1648f925441a18bba.tar.gz org.eclipse.jetty.project-9b9c7ba8d11a120a92f679a1648f925441a18bba.tar.xz org.eclipse.jetty.project-9b9c7ba8d11a120a92f679a1648f925441a18bba.zip |
416568 Simplified servlet exception logging
-rw-r--r-- | jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHandler.java | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHandler.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHandler.java index 013d6ed7eb..beb7bcbb35 100644 --- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHandler.java +++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHandler.java @@ -195,7 +195,14 @@ public class ServletHandler extends ScopedHandler { for (int i=_filters.length; i-->0;) { - try { _filters[i].stop(); }catch(Exception e){LOG.warn(Log.EXCEPTION,e);} + try + { + _filters[i].stop(); + } + catch(Exception e) + { + LOG.warn(Log.EXCEPTION,e); + } if (_filters[i].getSource() != Source.EMBEDDED) { //remove all of the mappings that were for non-embedded filters @@ -232,7 +239,14 @@ public class ServletHandler extends ScopedHandler { for (int i=_servlets.length; i-->0;) { - try { _servlets[i].stop(); }catch(Exception e){LOG.warn(Log.EXCEPTION,e);} + try + { + _servlets[i].stop(); + } + catch(Exception e) + { + LOG.warn(Log.EXCEPTION,e); + } if (_servlets[i].getSource() != Source.EMBEDDED) { @@ -527,16 +541,12 @@ public class ServletHandler extends ScopedHandler // unwrap cause Throwable th=e; - if (th instanceof UnavailableException) - { - LOG.debug(th); - } - else if (th instanceof ServletException) + if (th instanceof ServletException) { if (th instanceof QuietServletException) { - LOG.debug(th); LOG.warn(th.toString()); + LOG.debug(th); } else LOG.warn(th); @@ -548,22 +558,15 @@ public class ServletHandler extends ScopedHandler th=cause; } } - // handle or log exception else if (th instanceof EofException) - throw (EofException)th; - - else if (LOG.isDebugEnabled()) { - LOG.warn(request.getRequestURI(), th); - LOG.debug(request.toString()); - } - else if (th instanceof IOException || th instanceof UnavailableException) - { - LOG.debug(request.getRequestURI(),th); + throw (EofException)th; } else { LOG.warn(request.getRequestURI(),th); + if (LOG.isDebugEnabled()) + LOG.debug(request.toString()); } if (!response.isCommitted()) |