Mailing List webobjects-dev@wocommunity.org Message #94
From: Hugi Thordarson <webobjects-dev@wocommunity.org>
Subject: Re: [WO-DEV] Uncatchable Exception somewhere in DirectAction/D2W
Date: Wed, 3 Mar 2021 19:02:30 +0000
To: WebObjects & WOnder Development <webobjects-dev@wocommunity.org>
Hi Markus,
ERD2WDirectAction seems to be doing some really funky stuff to catch and handle exceptions in performActionNamed().
If there's no D2W involved you might want to consider inheriting from ERXDirectAction instead.


- hugi



On 3 Mar 2021, at 14:41, Markus Ruggiero (rucotec) <webobjects-dev@wocommunity.org> wrote:

I have a direct action that crashes and I cannot catch the exception. Why?

Scenario:

/**
 * dummy to demonstrate the issue
 */
public class DirectAction extends ERD2WDirectAction {

    public WOActionResults crashAction() throws Exception {
     throw new Exception("Crash in DirectAction");
    }
}

Where can I catch this Exception? It does not trigger anything in Application (which extends ERXApplication)
Both handle...() methods do not respond.

@Override
public WOResponse handleActionRequestError(WORequest aRequest, Exception exception, String reason,
WORequestHandler aHandler, String actionClassName, String actionName, Class actionClass,
WOAction actionInstance) {
// TODO Auto-generated method stub
return super.handleActionRequestError(aRequest, exception, reason, aHandler, actionClassName, actionName, actionClass,
actionInstance);
}

@Override
public WOResponse handleException(Exception anException, WOContext aContext)
{
super.handleException(anException, aContext);
        .......

The result of the crash is er.directtoweb.pages.templates.ERD2WMessagePageTemplate being rendered with my PageWrapper.

As there is (I assume) not much D2W involved here how do I trap this error and handle it my way? What am I missing?

Thanks for any idea
---markus---


Markus Ruggiero

rucotec GmbH                        web https://rucotec.ch
Steinenvorstadt 79                email markus.ruggiero@rucotec.ch
4051 Basel / Switzerland         mobile +41 79 508 4701









Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to Listmaster