You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by GitBox <gi...@apache.org> on 2020/07/07 12:34:46 UTC

[GitHub] [sling-org-apache-sling-distribution-journal-messages] amit-jain opened a new pull request #3: SLING-9569: Emit error code when error event received if available

amit-jain opened a new pull request #3:
URL: https://github.com/apache/sling-org-apache-sling-distribution-journal-messages/pull/3


   - Allow to send error code in the error event if available from MessagingException


----------------------------------------------------------------
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-distribution-journal-messages] amit-jain commented on a change in pull request #3: SLING-9569: Emit error code when error event received if available

Posted by GitBox <gi...@apache.org>.
amit-jain commented on a change in pull request #3:
URL: https://github.com/apache/sling-org-apache-sling-distribution-journal-messages/pull/3#discussion_r450894712



##########
File path: src/main/java/org/apache/sling/distribution/journal/ExceptionEventSender.java
##########
@@ -46,6 +47,12 @@ private Event createErrorEvent(Exception e) {
         Map<String, String> props = new HashMap<>();
         props.put(KEY_TYPE, e.getClass().getName());
         props.put(KEY_MESSAGE, e.getMessage());
+        if (e instanceof MessagingException) {

Review comment:
       Yes thanks but would also need to override the `send` method.




----------------------------------------------------------------
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-distribution-journal-messages] sonarcloud[bot] commented on pull request #3: SLING-9569: Emit error code when error event received if available

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #3:
URL: https://github.com/apache/sling-org-apache-sling-distribution-journal-messages/pull/3#issuecomment-654826417


   Kudos, SonarCloud Quality Gate passed!
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal-messages&pullRequest=3&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal-messages&pullRequest=3&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal-messages&pullRequest=3&resolved=false&types=BUG)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal-messages&pullRequest=3&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal-messages&pullRequest=3&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal-messages&pullRequest=3&resolved=false&types=VULNERABILITY) (and [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal-messages&pullRequest=3&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal-messages&pullRequest=3&resolved=false&types=SECURITY_HOTSPOT) to review)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal-messages&pullRequest=3&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal-messages&pullRequest=3&resolved=false&types=CODE_SMELL) [1 Code Smell](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-journal-messages&pullRequest=3&resolved=false&types=CODE_SMELL)
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-distribution-journal-messages&pullRequest=3&metric=new_coverage&view=list) [0.0% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-distribution-journal-messages&pullRequest=3&metric=new_coverage&view=list)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-distribution-journal-messages&pullRequest=3&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-distribution-journal-messages&pullRequest=3&metric=new_duplicated_lines_density&view=list)
   
   <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/message_warning.png' alt='warning' width='16' height='16' /> The version of Java (1.8.0_252) you have used to run this analysis is deprecated and we will stop accepting it from October 2020. Please update to at least Java 11.
   Read more [here](https://sonarcloud.io/documentation/upcoming/)
   
   
   


----------------------------------------------------------------
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-distribution-journal-messages] tmaret merged pull request #3: SLING-9569: Emit error code when error event received if available

Posted by GitBox <gi...@apache.org>.
tmaret merged pull request #3:
URL: https://github.com/apache/sling-org-apache-sling-distribution-journal-messages/pull/3


   


----------------------------------------------------------------
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-distribution-journal-messages] tmaret commented on a change in pull request #3: SLING-9569: Emit error code when error event received if available

Posted by GitBox <gi...@apache.org>.
tmaret commented on a change in pull request #3:
URL: https://github.com/apache/sling-org-apache-sling-distribution-journal-messages/pull/3#discussion_r450916092



##########
File path: src/main/java/org/apache/sling/distribution/journal/ExceptionEventSender.java
##########
@@ -46,6 +47,12 @@ private Event createErrorEvent(Exception e) {
         Map<String, String> props = new HashMap<>();
         props.put(KEY_TYPE, e.getClass().getName());
         props.put(KEY_MESSAGE, e.getMessage());
+        if (e instanceof MessagingException) {

Review comment:
       Good point, and bump the package export from 0.1.0 to 0.2.0.




----------------------------------------------------------------
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-distribution-journal-messages] tmaret commented on pull request #3: SLING-9569: Emit error code when error event received if available

Posted by GitBox <gi...@apache.org>.
tmaret commented on pull request #3:
URL: https://github.com/apache/sling-org-apache-sling-distribution-journal-messages/pull/3#issuecomment-654910889


   Merged, thanks @amit-jain 


----------------------------------------------------------------
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-distribution-journal-messages] tmaret commented on a change in pull request #3: SLING-9569: Emit error code when error event received if available

Posted by GitBox <gi...@apache.org>.
tmaret commented on a change in pull request #3:
URL: https://github.com/apache/sling-org-apache-sling-distribution-journal-messages/pull/3#discussion_r450916572



##########
File path: src/main/java/org/apache/sling/distribution/journal/ExceptionEventSender.java
##########
@@ -46,6 +47,12 @@ private Event createErrorEvent(Exception e) {
         Map<String, String> props = new HashMap<>();
         props.put(KEY_TYPE, e.getClass().getName());
         props.put(KEY_MESSAGE, e.getMessage());
+        if (e instanceof MessagingException) {

Review comment:
       Let's track that improvement separately.




----------------------------------------------------------------
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-distribution-journal-messages] tmaret commented on a change in pull request #3: SLING-9569: Emit error code when error event received if available

Posted by GitBox <gi...@apache.org>.
tmaret commented on a change in pull request #3:
URL: https://github.com/apache/sling-org-apache-sling-distribution-journal-messages/pull/3#discussion_r450886482



##########
File path: src/main/java/org/apache/sling/distribution/journal/ExceptionEventSender.java
##########
@@ -46,6 +47,12 @@ private Event createErrorEvent(Exception e) {
         Map<String, String> props = new HashMap<>();
         props.put(KEY_TYPE, e.getClass().getName());
         props.put(KEY_MESSAGE, e.getMessage());
+        if (e instanceof MessagingException) {

Review comment:
       One small suggestion, instead of using instanceof, we may override the method `createErrorEvent` with a method that passes a `MessagingException` as argument.




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