Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-4010

Allow validator to set a custom failure message

    XMLWordPrintableJSON

Details

    Description

      Currently the Validator may only return a boolean value or an exception in case the validator was called with invalid parametrization (https://github.com/apache/sling/blob/trunk/contrib/validation/api/src/main/java/org/apache/sling/validation/api/Validator.java).

      In some cases the validator could give some important information about why the validation failed. This is e.g. the cause for a reference validator where the cause for a failed validation could be:

      1. referenced resource is not existent
      2. referenced resource is not having the right resource type
      3. referenced resource is not activated

      So instead of only returning a boolean value, it should also be possible to return a failure message.

      Attachments

        Activity

          People

            bdelacretaz Bertrand Delacretaz
            kwin Konrad Windszus
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: