[
http://issues.apache.org/jira/browse/HIVEMIND-82?page=comments#action_64499 ]
Johan Lindquist commented on HIVEMIND-82:
-----------------------------------------
I'd say re-throw the application runtime exceptions un-changed, wrapping any
new, non-wrapped exceptions.
Maybe using a helper ...
public class SimpleExceptionHelper implements ExceptionHelper
{
public ApplicationRuntimeException
composeApplicationRuntimeException(Throwable t)
{
if (t instanceof ApplicationRuntimeException)
{
return (ApplicationRuntimeException)t;
}
return new ApplicationRuntimeException(....);
}
}
Exception handling code would then be:
try {
} catch (Exception e) {
throw _exceptionHelper.composeApplicationRuntimeException(e);
}
What do you think?
> Exception handling needs to allow RuntimeExceptions through rather than
> wrapping them yet again
> -----------------------------------------------------------------------------------------------
>
> Key: HIVEMIND-82
> URL: http://issues.apache.org/jira/browse/HIVEMIND-82
> Project: HiveMind
> Type: Improvement
> Components: framework
> Versions: 1.0, 1.1
> Reporter: Hal Hildebrand
> Priority: Minor
>
> There's a lot of creation of ApplicationRuntimeExceptions, a
> RuntimeException, in the framework. There are also quite a number of error
> handlers for Exception which wrap the Exception in an
> ApplicationRuntimeException. All of these error handlers should have another
> handler for RuntimeException which allows these exceptions to blow through
> without wrapping.
> for example, instead of:
> try {
> } catch (Exception e) {
> throw new ApplicationRuntimeException(UtilMessages.invokeFailed(c, ex),
> null, ex);
> }
> this should be:
> try {
> } catch (RuntimeException e) {
> throw e;
> } catch (Exception e) {
> throw new ApplicationRuntimeException(UtilMessages.invokeFailed(c, ex),
> null, ex);
> }
> This significantly cuts down on the redundant wrapping of
> ApplicationRuntimeExceptions. These redundant wrappings just make for HUGE
> stack traces which obscure where the problem really is. It also looks really
> ugly.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]