avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: avalon-sandbox/merlin/assembly-spi/src/java/org/apache/avalon/assembly/util ExceptionHelper.java
Date Sun, 20 Apr 2003 12:13:40 GMT
mcconnell    2003/04/20 05:13:40

  Modified:    merlin/assembly-spi/src/java/org/apache/avalon/assembly/util
                        ExceptionHelper.java
  Log:
  Imprement to exception report presentation.
  
  Revision  Changes    Path
  1.3       +13 -8     avalon-sandbox/merlin/assembly-spi/src/java/org/apache/avalon/assembly/util/ExceptionHelper.java
  
  Index: ExceptionHelper.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/assembly-spi/src/java/org/apache/avalon/assembly/util/ExceptionHelper.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ExceptionHelper.java	11 Apr 2003 20:28:34 -0000	1.2
  +++ ExceptionHelper.java	20 Apr 2003 12:13:40 -0000	1.3
  @@ -159,31 +159,36 @@
        * @param e the exception
        * @return String the formatting string
        */
  -    public static String packException( final String message, final Throwable e, boolean
stack )
  +    public static String packException( 
  +       final String message, final Throwable e, boolean stack )
       {
           StringBuffer buffer = new StringBuffer();
  -        buffer.append( "Message: " + message );
  -        buffer.append( "\n==================================================================="
);
  +        buffer.append( message );
           if( e == null )
           {
               return buffer.toString();
           } else
           {
  -            buffer.append( "\n\nException: " + e.getClass().getName() );
  -            buffer.append( "\n" + e.getMessage() );
  +            buffer.append( "\n" );
  +            buffer.append( 
  +"-------------------------------------------------------------------" );
  +            buffer.append( "\nException: " + e.getClass().getName() );
  +            buffer.append( "\nMessage: " + e.getMessage() );
               packCause( buffer, getCause( e ) ).toString();
  -            buffer.append( "\n\n==================================================================="
);
           }
           Throwable root = getLastThrowable( e );
           if( (root != null) && stack )
           {
  +            buffer.append( 
  +"\n\n---- stack trace --------------------------------------------------" );
               String[] trace = captureStackTrace( root );
               for( int i = 0; i < trace.length; i++ )
               {
                   buffer.append( "\n" + trace[i] );
               }
           }
  -        buffer.append( "\n==================================================================="
);
  +        buffer.append( 
  +"\n-------------------------------------------------------------------" );
           return buffer.toString();
       }
   
  @@ -194,7 +199,7 @@
               return buffer;
           }
           buffer.append( "\n\nCause: " + cause.getClass().getName() );
  -        buffer.append( "\n" + cause.getMessage() );
  +        buffer.append( "\nMessage: " + cause.getMessage() );
           return packCause( buffer, getCause( cause ) );
       }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message