commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lowe <>
Subject [email] Exceptions
Date Sun, 28 Nov 2004 15:04:19 GMT
The issue of exceptions has come up a few times, and heres a summary
of my understanding of whats been said and agreed and disagreed about.

The idea of throwing AddressException is favourable, but not at the
cost of needing to throw UnsupportingEncodingException. When setting
InternetAddress() this throws a UEE and AddressException.

My position is that without 1.4's new io package there's no means of
checking supported charsets on a given JVM. If the user enters a shady
charset for a email address or name is there anything wrong with them
having a UEE thrown?

The lightest means of doing this in my opinion is just throw both, its
consistent with the mailapi. It would work on all target JVMs.

Of course you could just throw MessagingException for everything , "oh
thats what it does". But is this a useful and therefore good thing?
Having  a commons.mail.EmailException was suggested, but does that
have any advantage over throwing AddressException and UEE? I'm not

I don't mind summitting the patches, i need to do this for a project
I'm working on at present, so I need to do the work anyway. It makes
sense to submit this to the effort but I don't mind either way.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message