Alexei Krainiouk created SLING-8374:
---------------------------------------

             Summary: Missing out exceptions in catch clause in 
DistributionSubscriber class
                 Key: SLING-8374
                 URL: https://issues.apache.org/jira/browse/SLING-8374
             Project: Sling
          Issue Type: Bug
          Components: Content Distribution
    Affects Versions: Content Distribution Journal Core 0.1.0
            Reporter: Alexei Krainiouk


There are two cases when catch clause is not catching necessary exceptions.
 #  in 
[DistributionSubscriber.timedSendStoredStatus|https://github.com/apache/sling-org-apache-sling-distribution-journal/blob/master/src/main/java/org/apache/sling/distribution/journal/impl/subscriber/DistributionSubscriber.java#L663]
 method. Apparently the intent is to catch an exception thrown by 
sendStatusMessage() method which in turn triggered by 
[sender.send()|https://github.com/apache/sling-org-apache-sling-distribution-journal/blob/master/src/main/java/org/apache/sling/distribution/journal/impl/subscriber/DistributionSubscriber.java#L690]
 invocation. However sender.send() method throws MessagingException which 
subclasses RuntimeError rather then Exception. As a result the exception is 
never caught.
 # in 
[DistributionSubscriber.importPackage|https://github.com/apache/sling-org-apache-sling-distribution-journal/blob/master/src/main/java/org/apache/sling/distribution/journal/impl/subscriber/DistributionSubscriber.java#L690]
 method. catch (Exception e) should be replaced with catch (Throwable e) in 
order to count all possible errors in failedPackageImports metric.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to