Wicket
  1. Wicket
  2. WICKET-4892

Provide helpful exception message in RequestCycle#urlFor()

    Details

      Description

      When something goes wrong while trying to get the URL for pageClass/pageParameters using RequestCycle, the exception message and its stacktrace is not very helpful in tracking down the component actually causing the problem. (See attached stacktrace that I while rendering a BookmarkablePageLink with a null parameter.)

      I suggest to catch any exceptions thrown by urlFor(IRequestHandler) and throwing a WicketRuntimeException having pageClass and pageparamters in its message. (See attached patch)

      1. urlFor-stacktrace.txt
        17 kB
        Peter Parson
      2. RequestCycle-urlFor-exception.patch
        2 kB
        Peter Parson

        Activity

        Peter Parson created issue -
        Hide
        Peter Parson added a comment -

        Example stacktrace and patch for helpful exception message

        Show
        Peter Parson added a comment - Example stacktrace and patch for helpful exception message
        Peter Parson made changes -
        Field Original Value New Value
        Attachment RequestCycle-urlFor-exception.patch [ 12554861 ]
        Attachment urlFor-stacktrace.txt [ 12554862 ]
        Peter Parson made changes -
        Issue Type Bug [ 1 ] Improvement [ 4 ]
        Peter Parson made changes -
        Priority Major [ 3 ] Minor [ 4 ]
        Martin Grigorov made changes -
        Summary Provide helpful exception message in RequestCycle#urlFor(Class, PageParameters) Provide helpful exception message in RequestCycle#urlFor()
        Hide
        Martin Grigorov added a comment -

        I've extended your patch to cover all #urlFor() variations.

        Show
        Martin Grigorov added a comment - I've extended your patch to cover all #urlFor() variations.
        Martin Grigorov made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Martin Grigorov [ mgrigorov ]
        Fix Version/s 6.4.0 [ 12323450 ]
        Resolution Fixed [ 1 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        2d 21h 29m 1 Martin Grigorov 29/Nov/12 12:39

          People

          • Assignee:
            Martin Grigorov
            Reporter:
            Peter Parson
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development