tmaret commented on code in PR #59:
URL: 
https://github.com/apache/sling-org-apache-sling-distribution-core/pull/59#discussion_r887645261


##########
src/main/java/org/apache/sling/distribution/servlet/DistributionAgentServlet.java:
##########
@@ -71,7 +73,7 @@ protected void doPost(SlingHttpServletRequest request, 
SlingHttpServletResponse
                 log.debug("distribution response : {}", distributionResponse);
             } catch (Throwable e) {
                 log.error("an unexpected error has occurred", e);
-                ServletJsonUtils.writeJson(response, 503, "an unexpected error 
has occurred", null);
+                ServletJsonUtils.writeJson(response, 503, e.getMessage(), 
null);

Review Comment:
   > Also I don't think if it's a good idea to expose the exception message 
potentially containing data which should not be exposed.
   
   +1. We can make the error more specific. In this case, I think that ideally 
the message should be
   
   ```
   Failed to create content package: Can't distribute package with size greater 
than 1 Byte, actual 4053
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to