You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by GitBox <gi...@apache.org> on 2021/01/14 15:35:07 UTC

[GitHub] [sling-org-apache-sling-jcr-resource] kwin opened a new pull request #13: SLING-10063 improve exception messages

kwin opened a new pull request #13:
URL: https://github.com/apache/sling-org-apache-sling-jcr-resource/pull/13


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [sling-org-apache-sling-jcr-resource] rombert commented on a change in pull request #13: SLING-10063 improve exception messages

Posted by GitBox <gi...@apache.org>.
rombert commented on a change in pull request #13:
URL: https://github.com/apache/sling-org-apache-sling-jcr-resource/pull/13#discussion_r557489404



##########
File path: src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiableValueMap.java
##########
@@ -455,13 +455,21 @@ public Object put(final String aKey, final Object value) {
                 node.setProperty(name, entry.convertToType(Value.class, node, this.helper.getDynamicClassLoader()));
             }
         } catch (final RepositoryException re) {
-            throw new IllegalArgumentException("Value for key " + key + " can't be put into node: " + value, re);
+            throw new IllegalArgumentException("Value '"+ value + "' for property '" + key + "' can't be put into node '" + getNodePath(node) + "'.", re);

Review comment:
       Right, sorry, I missed that. Nothing to change then.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [sling-org-apache-sling-jcr-resource] kwin merged pull request #13: SLING-10063 improve exception messages

Posted by GitBox <gi...@apache.org>.
kwin merged pull request #13:
URL: https://github.com/apache/sling-org-apache-sling-jcr-resource/pull/13


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [sling-org-apache-sling-jcr-resource] kwin commented on a change in pull request #13: SLING-10063 improve exception messages

Posted by GitBox <gi...@apache.org>.
kwin commented on a change in pull request #13:
URL: https://github.com/apache/sling-org-apache-sling-jcr-resource/pull/13#discussion_r557488645



##########
File path: src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiableValueMap.java
##########
@@ -455,13 +455,21 @@ public Object put(final String aKey, final Object value) {
                 node.setProperty(name, entry.convertToType(Value.class, node, this.helper.getDynamicClassLoader()));
             }
         } catch (final RepositoryException re) {
-            throw new IllegalArgumentException("Value for key " + key + " can't be put into node: " + value, re);
+            throw new IllegalArgumentException("Value '"+ value + "' for property '" + key + "' can't be put into node '" + getNodePath(node) + "'.", re);

Review comment:
       What do you suggest? Noone complained up till now, and the value was always logged (just at an unfortunate position in the string)




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [sling-org-apache-sling-jcr-resource] rombert commented on a change in pull request #13: SLING-10063 improve exception messages

Posted by GitBox <gi...@apache.org>.
rombert commented on a change in pull request #13:
URL: https://github.com/apache/sling-org-apache-sling-jcr-resource/pull/13#discussion_r557486821



##########
File path: src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiableValueMap.java
##########
@@ -455,13 +455,21 @@ public Object put(final String aKey, final Object value) {
                 node.setProperty(name, entry.convertToType(Value.class, node, this.helper.getDynamicClassLoader()));
             }
         } catch (final RepositoryException re) {
-            throw new IllegalArgumentException("Value for key " + key + " can't be put into node: " + value, re);
+            throw new IllegalArgumentException("Value '"+ value + "' for property '" + key + "' can't be put into node '" + getNodePath(node) + "'.", re);

Review comment:
       Would it make sense to trim the value here, in case it is extremely long?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org