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

Improve the exception handling of the DistributionPublisher.execute

    XMLWordPrintableJSON

Details

    Description

      In https://github.com/apache/sling-org-apache-sling-distribution-journal/blob/master/src/main/java/org/apache/sling/distribution/journal/impl/publisher/DistributionPublisher.java#L272 we are currently wrapping the exception that happens while trying to distribute content, which is resulting in the exception message for example:

      org.apache.sling.distribution.common.DistributionException: Can't distribute package with size greater than 1 Byte, actual 4055

       

      We need to change this wrapping, in order to obtain a more structured message, including the same information that we are logging:

      Failed to create content package for requestType=ADD, paths=[/content]. Error=Can't distribute package with size greater than 1 Byte, actual 4053

       

      This will allow for the content distribution API to deal with this error in a cleaner manner and provide more data to API users.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jose-correia José Correia
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: