Hi,
I am working on a messaging issue[1] to add more contextual info when
reporting messaging failure on CLI operations.
In this case, a JMS queue can not been added because the user specified
an invalid filter.
We throw a StartException with a cause Throwable (corresponding to the
invalid filter parsing) but the CLI console displays only the
StartException's message 'failed to create queue' and not its cause.
I have several ways to fix the issue and I am not sure which one is the
more appropriate for AS7:
1) I can fix the code in the messaging subsystem to append the cause's
localized message to the StartException message every time I throw one
2) In the controller code, when I report the StartException to the user,
I append the cause's l10ned message (if there is a cause) to
StartException.toString() message (this impacts all thrown
StartException, not only those from messaging subsystem)
3) I update StartException.toString() to append the cause message
I prefer (3) since as it is the only place where I would have to deal
with this but I don't realize the whole implication.
More generally, are there guidelines for reporting errors in AS7 CLI &
Web consoles? Are stacktraces acceptable? Is it up to every subsystems
to "prettify" their exceptions to provide all info in the message?
thanks,
jeff
[1]
https://issues.jboss.org/browse/AS7-1735
--
Jeff Mesnil
JBoss, a division of Red Hat
http://jmesnil.net/