avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <cziege...@s-und-n.de>
Subject RE: [Bug?]: ExcaliburComponentManager ignoring Exceptions
Date Tue, 23 Apr 2002 10:21:40 GMT

Peter Donald wrote:
> 
> On Tue, 23 Apr 2002 18:10, Carsten Ziegeler wrote:
> > Hi,
> >
> > it just took me days to find a problem in my application, because of
> > this code in lookup method of the ExcaliburComponentManager:
> >
> >             if( m_parentManager != null )
> >             {
> >                 try
> >                 {
> >                     return m_parentManager.lookup( role );
> >                 }
> >                 catch( Exception e )
> 
> 
> Maybe change the above liine to only catch ComponentExceptions ?
> 
Ok, my example was not complete :(

In my case the parent CM catches the NPE of the component and
rethrows it as a ComponentException. So if I change the above
line to catch only ComponentExceptions it's not better.

What about changing it to:

if( m_parentManager != null && m_parentManager.hasComponent( role ) )
{
    return parentManager.lookup( role );
}


Carsten

--
To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>


Mime
View raw message