You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2023/04/05 18:53:00 UTC

[jira] [Commented] (TAP5-1733) Throw bespoke exceptions so they may be more easily identified by Error Handlers

    [ https://issues.apache.org/jira/browse/TAP5-1733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17709065#comment-17709065 ] 

ASF subversion and git services commented on TAP5-1733:
-------------------------------------------------------

Commit d9a9eb330c515a68f645baae30b6ea7cf94cb2f2 in tapestry-5's branch refs/heads/master from Volker Lamp
[ https://gitbox.apache.org/repos/asf?p=tapestry-5.git;h=d9a9eb330 ]

TAP5-1733: Added FormsRequirePostException

> Throw bespoke exceptions so they may be more easily identified by Error Handlers
> --------------------------------------------------------------------------------
>
>                 Key: TAP5-1733
>                 URL: https://issues.apache.org/jira/browse/TAP5-1733
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.3
>            Reporter: Steve Eynon
>            Assignee: Volker Lamp
>            Priority: Minor
>              Labels: bulk-close-candidate
>
> Two exceptions in particular tend to be thrown prolifically by live sites when they are crawled by robots. They are:
>  - java.lang.RuntimeException: Forms require that the request method be POST and that the t:formdata query parameter have values.
>  - java.lang.IllegalArgumentException: Input string 'XXX' is not valid; the character 'X' at position X is not valid.
> To save needless reporting of benign errors (and to prevent the error logs from filling up) these exceptions are usually ignored by implementing Error Handlers. But the ErrorHandler has to currently check the exception message:
> if (e.getMessage().contains("Forms require that the request method be POST")) {
>     doIgnore();
> }
> which is both brittle and nasty. Instead it'd be great if Tapestry could throw some bespoke exceptions so the above could be re-written as:
> if (e instanceof FormsRequirePostException) {
>     doIngore();
> }
> Email thread below:
> http://tapestry.1045711.n5.nabble.com/Safari-for-example-browser-history-and-form-exception-td4942074.html



--
This message was sent by Atlassian Jira
(v8.20.10#820010)