Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-2356

component report more informative message on error loading model object

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.4-RC6
    • 1.5-M1
    • wicket
    • None

    Description

      Because at org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:439) throws a WicketException, the component location etc are not shown which makes it hard to track down. This patch causes the component detail to be shown shown, to help track down problems.

      Index: src/main/java/org/apache/wicket/Component.java
      ===================================================================
      — src/main/java/org/apache/wicket/Component.java (revision 780169)
      +++ src/main/java/org/apache/wicket/Component.java (working copy)
      @@ -1650,7 +1650,14 @@
      if (model != null)
      {
      // Get model value for this component.

      • return model.getObject();
        + try
        + { + return model.getObject(); + }

        + catch (Exception e)
        +

        { + throw new RuntimeException(e); + }

        }
        else
        {
        @@ -2665,7 +2672,8 @@

        { throw re; }
      • throw new WicketRuntimeException("Exception in rendering component: " + this, re);
        + throw new WicketRuntimeException("Exception in rendering component: " +
        + this.toString(true), re);
        }
        }

      Attachments

        Activity

          People

            jdonnerstag Juegen Donnerstag
            astubbs Antony Stubbs
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: