kwin commented on code in PR #61:
URL:
https://github.com/apache/sling-org-apache-sling-api/pull/61#discussion_r2159982991
##########
src/main/java/org/apache/sling/api/resource/PersistenceException.java:
##########
@@ -91,4 +95,34 @@ public String getResourcePath() {
public String getPropertyName() {
return this.propertyName;
}
+
+ /**
+ * Returns a message for this exception.
+ * If the cause is not null, it will be appended to the message.
+ * @return The message for this exception
+ */
+ @Override
+ public String getMessage() {
Review Comment:
Also I would appreciate your opinion whether this should be fixed rather in
the consumer or when throwing the exception, I don't really know to be honest.
I have seen patterns like this
https://github.com/apache/sling-org-apache-sling-jcr-resource/blob/fe35d53a1b0f8ff1a7616909f16539b759bd0bdd/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java#L540
which seem wrong to me as that clearly duplicates information. However always
exposing the root cause for every exception in
https://github.com/apache/sling-org-apache-sling-servlets-post/blob/7ff7280c7ba89592186ac76d33b481d73abba323/src/main/java/org/apache/sling/servlets/post/AbstractPostResponse.java#L286
might be too much as well...
--
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]