I guess the original assumption was that avalon Configuration doesn't throw
an exception on a not supplied attribute, and an occassional
ConfigurationException indicates some exotic problem.

current implementation of getInitAttribute(String name):
        try {
            return configuration.getAttribute(name);
        } catch (ConfigurationException ce) {
            throw new RuntimeException("Embedded configuration exception
was: " + ce.getMessage());
        }

I propose the following change:
doc: it returns the attribute value or null if the attribute is not supplied
or empty
code: return configuration.getAttribute(name, null);






----- Original Message ----- 
From: "Hontvari Jozsef" <[EMAIL PROTECTED]>
To: "James Developers List" <[EMAIL PROTECTED]>
Sent: Wednesday, June 25, 2003 9:59 AM
Subject: exception: No attribute named "onMailetException"


> I have got an error notification email with the following reason:
>
> "Error message below:
> Embedded configuration exception was: No attribute named
"onMailetException"
> is associated with the configuration element "mailet" at
> file:/C:/james/apps/james/SAR-INF/config.xml:178:-1"
>
> (Interestingly I cannot find this message in the log, which may indicate
> another problem.)
>
> Looking at the source of MailetConfigImpl and the javadoc of the avalon
> Configuration class it turns out that the avalon class throws an exception
> if the attribute is not supplied. (On the other hand it has another
method,
> which has a default value parameter, that doesn't throw an exception). The
> javadoc on MailetConfigImpl getInitAttribute doesn't specify its behaviour
> if the attribute is not supplied. Actually it throws a RuntimeException. I
> am not sure what was to original intent, but the it should be decided and
> documented. (I can submit a patch if it is decided.)
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to