avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen McConnell <mcconn...@apache.org>
Subject Re: Useful error messages
Date Thu, 28 Aug 2003 22:05:33 GMT

Hi guys:

I figured that this would be a perfect opportuntity to show Noel what a 
little advanced engineering can do in terms of nice exception handling 
if your using that "other" container. So I dug into my james 
installation and made the same file://c:/whatever reference, thinking to 
myself that I would get a nice consolidated report of the problem along 
the lines of the following:

http://www.ibiblio.org/merlin/tmp/merlin-report.txt

However, I was confronted with some extra information that I was not 
expecting:

http://www.ibiblio.org/merlin/tmp/james-generated.txt

So I did some digging .....
.. and in the James source for RepositoryManager I noticed the following:

}
catch( final Exception e )
{
final String message = "Cannot find or init repository: " + e.getMessage();
getLogger().warn( message, e );
throw new ServiceException("", message, e );
}

Which means that the exception is being recorded to the log twice. Once 
by james (under the getLogger().warn( .. ), and once my Phoneix (or 
whatever advanced container solution your running) during exception 
handling. But wait - it gets more interesting - in AvalonMailStore 
(which is actually the "JamesMailStore") we have the following fragment:

} catch (Exception e) {
if (getLogger().isWarnEnabled()) {
getLogger().warn( "Exception while creating repository:" +
e.getMessage(), e );
}
e.printStackTrace();
throw new
ServiceException("","Cannot find or init repository",
e);
}

Which means that the error is:

(a) logged explicity by the component
(b) spat out as a stack trace
(c) and logged by the container

This suggests that there is a signal to noise problem that really is not 
a question of Phoenix exception handling - instead, its a question of 
who is responsible for logging errors. As a rule I NEVER log an 
exception AND throw it. The only time you need to log an exception is 
when you don't intent to throw it. Secondly, doing a seach though the 
james code for e.getStackTrace() produced more than a couple of files. 
Either this is debugging that should have been stripped out of the code, 
or it should be dealt with properly.

Finally, onto some Avalon concerns.

Two points:

(a) configuration exceptions would be more useful if they contained
the offending fragment
(b) better specs are needed about component/container seperation
of responsibilities (e.g. who handled error reporting)

Cheers, Steve.



Noel J. Bergman wrote:

>Anders,
>
>I don’t disagree that the error message from Phoenix is poor, and I have
>already forwarded your complaint to the Avalon Developer list.  However,
>your encounter with it is not the norm.  So I don’t believe that “most new
>users” encounter it.  This is not to dismiss it.  The complaint is valid.
>If someone wants to find where in the Avalon code that should be made, I
>believe that we may now have direct commit rights to that part of the CVS.
>
>Avalon is close to finishing a coordinated release process that has taken
>then most of this year, so we will probably look to update our deployment
>when they finish.
>
>	--- Noel
>
>-----Original Message-----
>From: boxed [mailto:boxed@home.se]
>Sent: Thursday, August 28, 2003 13:14
>To: James Users List
>Subject: Re: Useful error messages
>
>
>Noel J. Bergman wrote:
>
>
>>Configuration for James is actually rather simple.  It comes pretty much
>>configured for basic operation, and advanced stuff is fairly easy, too.
>>Much easier than sendmail, qmail, etc.  I think that the problem you ran
>>into was because you didn’t realize the meaning of a file URL, which is
>>documented in the config.xml, by the way, and did MORE configuration than
>>you needed to do.
>>
>>
>>
>
>I disagree. Sure, there is little real config needed to do, but my real
>problem (and I suspect most new users problem) is that if I screw it up,
>it gives me 300 lines of total crap instead of just saying "you fucked
>up line x in this way".  Try doing a nested XML comment in some place of
>config.xml by the way. It will give you a 300 line stack trace error
>_without telling you what line the error is on_.
>
>The user experience from the first 10 minutes I spent on this product
>were totally horrible. If you intend to compete with commercial products
>(and I really hope you do) the end user experience must be taken into
>account.
>
>Anders Hovmöller
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>For additional commands, e-mail: server-user-help@james.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
>For additional commands, e-mail: dev-help@avalon.apache.org
>
>
>

-- 

Stephen J. McConnell
mailto:mcconnell@apache.org
http://www.osm.net

Sent via James running under Merlin as an NT service.
http://avalon.apache.org/sandbox/merlin




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


Mime
View raw message