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. RequestCycle-urlFor-exception.patch
        2 kB
        Peter Parson
      2. urlFor-stacktrace.txt
        17 kB
        Peter Parson

        Activity

        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
        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.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development