Precisely. If an exception is bubbled up to the point that the stack
trace is dumped, then this is not proper design but a real,
As Brian suggested, exceptions that are 'expected' (and while this
smells of bad design initially, could still be valid if these are
truly infrequent circumstances but need appropriate reaction) would
probably be also caught by design, and dealt with.
If you are referring to purposefully dumping a stack trace as a part
of handling this exception, then keep this to DEBUG or below, as this
*does* freak users out! :-)
Lead, JBoss Cache
JBoss, a division of Red Hat
Telephone: +44 7786 702 706
On 21 Dec 2006, at 19:08, Brian Stansberry wrote:
> Sometimes I come across a case where a good design principle
> for a flow of control is to raise an exception. Exceptions
> are usually logged and stack trace is dumped. In some of
> these cases exceptions happen due to expected circumstances
> (i.e request to activate region when region is not active)
> and so on. I am getting an impression (maybe a false one)
> that users freak out when the see stack traces and thus I am
> reluctant to raise an Exception in some of these cases and
> make a workaround.
> What do you guys do about this problem? Is there a way to
> have a generic catch clause for Exception but somehow
> indicate if stacktrace should be dumped or not to a logger?
> Or should I just forget about this impression (of freaking
> out users) and raise exceptions whenever a good design dictates it?
If the exception is raised for a good design purpose, wouldn't that
mean it should be handled somewhere and not propagate to arbitrary
And then proper logging design means it shouldn't be logged
the way to wherever it's handled, or at least not at anything above
jbosscache-dev mailing list