sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1637975 - /sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/RemoteDistributionPackageImporter.java
Date Mon, 10 Nov 2014 20:26:38 GMT
Author: tommaso
Date: Mon Nov 10 20:26:37 2014
New Revision: 1637975

URL: http://svn.apache.org/r1637975
Log:
SLING-4150 - throw an exception if remote importer transport fails

Modified:
    sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/RemoteDistributionPackageImporter.java

Modified: sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/RemoteDistributionPackageImporter.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/RemoteDistributionPackageImporter.java?rev=1637975&r1=1637974&r2=1637975&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/RemoteDistributionPackageImporter.java
(original)
+++ sling/trunk/contrib/extensions/distribution/core/src/main/java/org/apache/sling/distribution/packaging/impl/importer/RemoteDistributionPackageImporter.java
Mon Nov 10 20:26:37 2014
@@ -70,15 +70,13 @@ public class RemoteDistributionPackageIm
 
     }
 
-    public boolean importPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionPackage
distributionPackage) {
-        boolean result = false;
+    public boolean importPackage(@Nonnull ResourceResolver resourceResolver, @Nonnull DistributionPackage
distributionPackage) throws DistributionPackageImportException {
         try {
             transportHandler.deliverPackage(resourceResolver, distributionPackage);
-            result = true;
+            return true;
         } catch (Exception e) {
-            log.error("failed in importing package {} ", distributionPackage, e);
+            throw new DistributionPackageImportException("failed in importing package " +
distributionPackage);
         }
-        return result;
     }
 
     public DistributionPackage importStream(@Nonnull ResourceResolver resourceResolver, @Nonnull
InputStream stream) throws DistributionPackageImportException {



Mime
View raw message