cschneider commented on code in PR #59: URL: https://github.com/apache/sling-org-apache-sling-distribution-core/pull/59#discussion_r887553854
########## src/main/java/org/apache/sling/distribution/servlet/DistributionPackageImporterServlet.java: ########## @@ -126,8 +127,10 @@ protected void doPost(SlingHttpServletRequest request, SlingHttpServletResponse ServletJsonUtils.writeJson(response, SC_OK, "package imported successfully", null); } catch (final Throwable e) { - ServletJsonUtils.writeJson(response, SC_INTERNAL_SERVER_ERROR, "an unexpected error has occurred during distribution import", null); - log.error("Error during distribution import", e); + String msg = format("an unexpected error has occurred during distribution import. Error:%s", + e.getMessage()); + log.error(msg, e); + ServletJsonUtils.writeJson(response, SC_INTERNAL_SERVER_ERROR, msg, null); Review Comment: I think currently we have no means of determining if the error is because of bad data sent by the client or because of some internal problem. So in my opinion 500 is ok. I also think current client would not be prepared to distinguish different status codes. Do you have a concrete proposal how to improve the code? -- 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: dev-unsubscr...@sling.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org