avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craft...@apache.org
Subject cvs commit: avalon/fortress/container/src/impl/org/apache/avalon/fortress/impl AbstractContainer.java
Date Mon, 23 Jun 2003 15:09:55 GMT
crafterm    2003/06/23 08:09:54

  Modified:    fortress/container/src/impl/org/apache/avalon/fortress/impl
                        AbstractContainer.java
  Log:
  Ensure that any CascadingExceptions that are thrown also have their 'cause'
  logged during component creation. This helps debugging by displaying
  nested exceptions that otherwise go unlogged.
  
  Revision  Changes    Path
  1.39      +16 -1     avalon/fortress/container/src/impl/org/apache/avalon/fortress/impl/AbstractContainer.java
  
  Index: AbstractContainer.java
  ===================================================================
  RCS file: /home/cvs/avalon/fortress/container/src/impl/org/apache/avalon/fortress/impl/AbstractContainer.java,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- AbstractContainer.java	23 Jun 2003 12:51:20 -0000	1.38
  +++ AbstractContainer.java	23 Jun 2003 15:09:54 -0000	1.39
  @@ -66,6 +66,7 @@
   import org.apache.avalon.fortress.util.dag.CyclicDependencyException;
   import org.apache.avalon.fortress.util.dag.DirectedAcyclicGraphVerifier;
   import org.apache.avalon.fortress.util.dag.Vertex;
  +import org.apache.avalon.framework.CascadingException;
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.activity.Initializable;
   import org.apache.avalon.framework.configuration.Configuration;
  @@ -670,6 +671,20 @@
                           }
                           break;
                   }
  +            }
  +            catch ( final CascadingException e )
  +            {
  +                final String cName = entry.getMetaData().getName();
  +
  +                if ( getLogger().isWarnEnabled() )
  +                {
  +                    final String message = "Could not initialize component " + cName;
  +                    getLogger().warn( message, e );
  +
  +                    final String cause = "Cause for exception";
  +                    getLogger().warn( cause, e.getCause() );
  +                }
  +                buffer.add( e );
               }
               catch ( final Exception e )
               {
  
  
  

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


Mime
View raw message