Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-1733

Throw bespoke exceptions so they may be more easily identified by Error Handlers

    XMLWordPrintableJSON

Details

    Description

      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

      Attachments

        Issue Links

          Activity

            People

              vlamp Volker Lamp
              slimerdude Steve Eynon
              Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h