james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincenzo Gianferrari Pini" <vincenzo.gianferrarip...@praxis.it>
Subject RE: MailetException vs MessagingException
Date Mon, 20 Oct 2003 14:58:12 GMT
I agree, but Matcher.match(Mail), Matcher.init(MatcherConfig), Mailet.service(Mail) and Mailet.init(MailetConfig)
are all defined as "throws javax.mail.MessagingException", so I guess that MailetException
must continue to extend MessagingException.

Now, shall we refactor? It may not be important, but sometimes some cleanup must be done,
and it could become useful in the future. I would use only MailetException, both for throwing
new error conditions and wrapping non-MessagingException kind of Exception-s. If we all agree
I can doit in org.apache.james.transport.* (and by the way systematically add the "@version
CVS $Revision:$" javadoc entry). Let me know.

Vincenzo

> -----Original Message-----
> From: Danny Angus [mailto:Danny_Angus@slc.co.uk]
> Sent: lunedi 20 ottobre 2003 15.02
> To: James Developers List
> Subject: Re: MailetException vs MessagingException
> 
> 
> 
> 
> 
> 
> 
> Vincenzo,
> 
> > This may be just a matter of clean code, but browsing around 
> the matchers
> and mailets in CVS, I found that many of them are
> > throwing MessagingException-s instead of MailetException-s (including my
> own code ;-).
> 
> 
> This is just a guess, but I seem to remember thinking that MailetException
> was thrown by the container on catching an exception raised in, or
> propogated by, a mailet or matcher, whereas messaging exception is raised
> by failure to handle a message.
> 
> On the other hand it makes sense that mailets throw only new
> MailetExceptions but can propogate MessagingExceptions raised in JavaMail.
> Because you can then distinguish between mailet problems and java mail
> related ones.
> 
> I'd support a refactoring to only use one of them, or one that used both
> but made MailetException extend Exception not MessagingException, on the
> basis that MailetException isn't usefully a specialisation of
> MessagingException, and MessagingException is regarded (by me at least) as
> "JavaMail exception".
> 
> d.
> 
> 
> 
> ******************************************************************
> *********
> The information in this e-mail is confidential and for use by the 
> addressee(s) only. If you are not the intended recipient (or 
> responsible for delivery of the message to the intended 
> recipient) please notify us immediately on 0141 306 2050 and 
> delete the message from your computer. You may not copy or 
> forward it or use or disclose its contents to any other person. 
> As Internet communications are capable of data corruption Student 
> Loans Company Limited does not accept any  responsibility for 
> changes made to this message after it was sent. For this reason 
> it may be inappropriate to rely on advice or opinions contained 
> in an e-mail without obtaining written confirmation of it. 
> Neither Student Loans Company Limited or the sender accepts any 
> liability or responsibility for viruses as it is your 
> responsibility to scan attachments (if any). Opinions and views 
> expressed in this e-mail are those of the sender and may not 
> reflect the opinions and views of The Student Loans Company Limited.
> 
> This footnote also confirms that this email message has been 
> swept for the presence of computer viruses.
> 
> **************************************************************************
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
> 


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


Mime
View raw message