cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/servlet CocoonServlet.java
Date Sat, 22 Feb 2003 23:23:36 GMT
pier        2003/02/22 15:23:36

  Modified:    src/java/org/apache/cocoon/servlet CocoonServlet.java
  Log:
  Fix potential NPEs in the CocoonServlet "manageException()" method making
  sure that if we look for a nested exception, we actually _get_ one...
  
  Revision  Changes    Path
  1.50      +5 -5      xml-cocoon2/src/java/org/apache/cocoon/servlet/CocoonServlet.java
  
  Index: CocoonServlet.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/servlet/CocoonServlet.java,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- CocoonServlet.java	17 Feb 2003 22:05:19 -0000	1.49
  +++ CocoonServlet.java	22 Feb 2003 23:23:36 -0000	1.50
  @@ -1173,16 +1173,16 @@
   
                   // VG: Do not show exception trace on NotFound error, add only exception
message.
                   if (e != null) {
  -                    extraDescriptions.put(Notifying.EXTRA_CAUSE,
  -                                          DefaultNotifyingBuilder.getRootCause(e).getMessage());
  +                    Throwable t = DefaultNotifyingBuilder.getRootCause(e);
  +                    if (t != null) extraDescriptions.put(Notifying.EXTRA_CAUSE, t.getMessage());
                       e = null;
                   }
               }
   
               // Do not show exception stack trace when log level is WARN or above. Show
only message.
               if (!log.isInfoEnabled()) {
  -                extraDescriptions.put(Notifying.EXTRA_CAUSE,
  -                                      DefaultNotifyingBuilder.getRootCause(e).getMessage());
  +                Throwable t = DefaultNotifyingBuilder.getRootCause(e);
  +                if (t != null) extraDescriptions.put(Notifying.EXTRA_CAUSE, t.getMessage());
                   e = null;
               }
   
  
  
  

Mime
View raw message