X-CGP-ClamAV-Result: CLEAN X-VirusScanner: Niversoft's CGPClamav Helper v1.22.2a (ClamAV engine v0.102.2) X-Junk-Score: 0 [] X-KAS-Score: 0 [] From: "Hugi Thordarson" Received: from mail-02.1984.is ([185.112.145.70] verified) by post.selbstdenker.com (CommuniGate Pro SMTP 6.3.3) with ESMTPS id 25516492 for webobjects-dev@wocommunity.org; Wed, 03 Mar 2021 20:02:57 +0100 Received-SPF: none receiver=post.selbstdenker.com; client-ip=185.112.145.70; envelope-from=hugi@karlmenn.is Received: from localhost by mail-02.1984.is with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lHWlT-0003Wl-M5 for webobjects-dev@wocommunity.org; Wed, 03 Mar 2021 19:02:31 +0000 Content-Type: multipart/alternative; boundary="Apple-Mail=_965E6540-9744-4E27-B7CA-62D037B5CDA7" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: [WO-DEV] Uncatchable Exception somewhere in DirectAction/D2W Date: Wed, 3 Mar 2021 19:02:30 +0000 References: To: WebObjects & WOnder Development In-Reply-To: Message-Id: X-Mailer: Apple Mail (2.3608.120.23.2.4) --Apple-Mail=_965E6540-9744-4E27-B7CA-62D037B5CDA7 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii 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. = https://github.com/wocommunity/wonder/blob/e8ce291acc97e0c98738ad762fd00d9= c7da9e13c/Frameworks/Core/ERDirectToWeb/Sources/er/directtoweb/ERD2WDirect= Action.java#L444-L470 = - hugi > On 3 Mar 2021, at 14:41, Markus Ruggiero (rucotec) = wrote: >=20 > I have a direct action that crashes and I cannot catch the exception. = Why? >=20 > Scenario: >=20 > /** > * dummy to demonstrate the issue > */ > public class DirectAction extends ERD2WDirectAction { >=20 > public WOActionResults crashAction() throws Exception { > throw new Exception("Crash in DirectAction"); > } > } >=20 > Where can I catch this Exception? It does not trigger anything in = Application (which extends ERXApplication) > Both handle...() methods do not respond. >=20 > @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); > } >=20 > @Override > public WOResponse handleException(Exception anException, = WOContext aContext) > { > super.handleException(anException, aContext); > ....... >=20 > The result of the crash is = er.directtoweb.pages.templates.ERD2WMessagePageTemplate being rendered = with my PageWrapper. >=20 > 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? >=20 > Thanks for any idea > ---markus--- >=20 >=20 > Markus Ruggiero >=20 > rucotec GmbH web https://rucotec.ch = > Steinenvorstadt 79 email markus.ruggiero@rucotec.ch = > 4051 Basel / Switzerland mobile +41 79 508 4701 >=20 >=20 >=20 >=20 >=20 >=20 >=20 >=20 --Apple-Mail=_965E6540-9744-4E27-B7CA-62D037B5CDA7 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii 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&nbs= p;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,&n= bsp;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 anExcept= ion, 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









= --Apple-Mail=_965E6540-9744-4E27-B7CA-62D037B5CDA7--