[webbeans-dev] Subclasses of DefinitionException

Gavin King gavin at hibernate.org
Wed Jan 14 04:34:05 EST 2009


On Wed, Jan 14, 2009 at 8:29 PM, Max Rydahl Andersen
<max.andersen at redhat.com> wrote:
> Does it hurt to have self explanatory exception names for exceptions ?

No, but that is up to the implementation. It can throw a subclass of
DefinitionException, that is permitted by the spec.

> It also helps when a tool sees a stacktrace to provide "hyperlinking" to the
> relevant docs or
> even the class mentioned in there - there could even be automatic quickfixes
> made based on
> these (i.e. "Create method foo on class X" when NonexistentMethodException)

Again, this still works if the subclass is vendor-specific.

> I know the reason you want them out of the spec is to avoid having to define
> when each exception is thrown,

No, the real reason is that there is a corner case when processing the
XML format where we're not sure if its a method or a field that is
missing ;-)

-- 
Gavin King
gavin.king at gmail.com
http://in.relation.to/Bloggers/Gavin
http://hibernate.org
http://seamframework.org



More information about the weld-dev mailing list