Tapestry
  1. Tapestry
  2. TAPESTRY-670

PageNotFoundException should include the requested page name as a property

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: 4.1.1
    • Component/s: Framework
    • Labels:
      None

      Description

      I think the summary says it all. It's useful for custom "page not found" pages to extract the requested page name from the PageNotFoundException and display customized messages.

        Activity

        Hide
        Andreas Andreou added a comment -

        Added getPageName() in PageNotFoundException class.

        Show
        Andreas Andreou added a comment - Added getPageName() in PageNotFoundException class.
        Hide
        Andreas Andreou added a comment -

        i meant to say: "the only place where such an exception is constructed"

        Show
        Andreas Andreou added a comment - i meant to say: "the only place where such an exception is constructed"
        Hide
        Andreas Andreou added a comment -

        AFAICT, resolve(IRequestCycle cycle, String prefixedName) of PageSpecificationResolverImpl
        is the only place where such an exception is thrown. That methods already knows the page in
        question (_simpleName) and builds an error message using it.

        So, adding an additional constructor PageNotFoundException(String page, String message)
        and providing a getter is all it takes to fix this. I believe it's worth it, anyone against this?

        Show
        Andreas Andreou added a comment - AFAICT, resolve(IRequestCycle cycle, String prefixedName) of PageSpecificationResolverImpl is the only place where such an exception is thrown. That methods already knows the page in question (_simpleName) and builds an error message using it. So, adding an additional constructor PageNotFoundException(String page, String message) and providing a getter is all it takes to fix this. I believe it's worth it, anyone against this?

          People

          • Assignee:
            Andreas Andreou
            Reporter:
            Leonardo Quijano Vincenzi
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development