Yes, it's possible. I'm still doing it the old Tapestry3 way...
overriding Engine.activateExceptionPage().  The guts of the code:

    protected void activateExceptionPage(IRequestCycle cycle, Throwable
cause) {
        ExceptionDescription[] edArray = new
ExceptionAnalyzer().analyze(cause);
        ExceptionDescription ed = edArray[0];
        String message = ed.getMessage();

        if (message != null && message.indexOf("does not contain a
component") != -1) {
            // write something to the log here
            cycle.activate("UnexpectedError");   // page of your choice
            renderResponse(cycle);
            // Don't fall through to the usual error handler
            return;      
        }

        // ... the usual error handler...
    }

In Tapestry4, though, I should probably be getting away from a custom
Engine.  Custom error handlers can be configured as ExceptionPresenter
contributions.


Daniel M Garland wrote:

> Hi all,
>
> How do I handle 'page X does not contain a component' exceptions; I
> get about 5 a day in my web app - they happen on a variety of pages
> and on a variety of components. I presume that its caused by people
> manually messing around with tapestry's URLs. Is there some engine
> method I can override to catch this and say direct people to the
> homepage?
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to