You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Martijn Dashorst <ma...@gmail.com> on 2008/01/10 00:04:44 UTC

RequestCycle#onRuntimeException's provided exception

Wicket currently provides RequestCycle#onRuntimeException with the
full exceptions, including the Wicket wrapped exceptions. Is this
something we should/could improve on?

For instance the thrown exception in this onclick handler:

add(new Link("foo") {
    public void onClick() {
        throw new RuntimeException();
    }
});

will be wrapped twice: first in an InvocationTargetException and that
inside a WicketRuntimeException.

Now I'm not saying there's completely no value in the WRE and ITE, but
to get to the core of what is happening, the onError implementor needs
to go through the whole cause stack to figure out what has happened.

We could at least strip off those wrapper exceptions that were under
control of Wicket: the WRE and the ITE are likely candidates IMO.

WDYT?

Martijn

-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0

Re: RequestCycle#onRuntimeException's provided exception

Posted by Johan Compagner <jc...@gmail.com>.
ITE is not really what wicket does. But we could unwrap those first.
And then chekc if it is a runtime and just throw that one and wrap an
none runtimew in wicketexp and throw. But we have to be carefull about
loosing stuff but ITE is not a big problem.

On 1/10/08, Martijn Dashorst <ma...@gmail.com> wrote:
> Wicket currently provides RequestCycle#onRuntimeException with the
> full exceptions, including the Wicket wrapped exceptions. Is this
> something we should/could improve on?
>
> For instance the thrown exception in this onclick handler:
>
> add(new Link("foo") {
>     public void onClick() {
>         throw new RuntimeException();
>     }
> });
>
> will be wrapped twice: first in an InvocationTargetException and that
> inside a WicketRuntimeException.
>
> Now I'm not saying there's completely no value in the WRE and ITE, but
> to get to the core of what is happening, the onError implementor needs
> to go through the whole cause stack to figure out what has happened.
>
> We could at least strip off those wrapper exceptions that were under
> control of Wicket: the WRE and the ITE are likely candidates IMO.
>
> WDYT?
>
> Martijn
>
> --
> Buy Wicket in Action: http://manning.com/dashorst
> Apache Wicket 1.3.0 is released
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0
>

Re: RequestCycle#onRuntimeException's provided exception

Posted by Eelco Hillenius <ee...@gmail.com>.
> Wicket currently provides RequestCycle#onRuntimeException with the
> full exceptions, including the Wicket wrapped exceptions. Is this
> something we should/could improve on?
>
> For instance the thrown exception in this onclick handler:
>
> add(new Link("foo") {
>     public void onClick() {
>         throw new RuntimeException();
>     }
> });
>
> will be wrapped twice: first in an InvocationTargetException and that
> inside a WicketRuntimeException.
>
> Now I'm not saying there's completely no value in the WRE and ITE, but
> to get to the core of what is happening, the onError implementor needs
> to go through the whole cause stack to figure out what has happened.

Not sure. We can explore this. But I'm very weary of loosing too much info.

Eelco