You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Angelo Chen <an...@yahoo.com.hk> on 2009/03/15 14:51:28 UTC
t5: catching exception in onException
Hi,
I'm trying to use onException to catch exceptions, when I throw an exception
from onActivate, onException can catch it, but if it is thrown from
getEntries which is a property accessed from the .tml, onException can't
catch it, t5's ExceptionReport got it, any idea why I can't catch this
exception in the onException?
Thanks,
// this can not be catched
public List<VideoEntry> getEntries() throws Throwable {
throw new Exception("aaa");
}
// this can be catched
Object onActivate(String code) throws Throwable {
throw new Exception("bbb");
}
Object onException(Throwable cause) {
return PageNotFound.class;
}
--
View this message in context: http://www.nabble.com/t5%3A-catching-exception-in-onException-tp22523406p22523406.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: t5: catching exception in onException
Posted by luna_guo <gh...@163.com>.
See http://tapestry.apache.org/tapestry5/guide/event.html
onException caches exceptions throwed by event handlers.
Angelo Chen wrote:
>
> Hi,
>
> I'm trying to use onException to catch exceptions, when I throw an
> exception from onActivate, onException can catch it, but if it is thrown
> from getEntries which is a property accessed from the .tml, onException
> can't catch it, t5's ExceptionReport got it, any idea why I can't catch
> this exception in the onException?
>
> Thanks,
>
>
> // this can not be catched
> public List<VideoEntry> getEntries() throws Throwable {
> throw new Exception("aaa");
> }
>
> // this can be catched
> Object onActivate(String code) throws Throwable {
> throw new Exception("bbb");
> }
>
> Object onException(Throwable cause) {
> return PageNotFound.class;
> }
>
--
View this message in context: http://www.nabble.com/t5%3A-catching-exception-in-onException-tp22523406p22530277.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org