You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by pa...@apache.org on 2021/12/16 14:08:58 UTC

[sling-org-apache-sling-feature-cpconverter] branch master updated: SLING-10929 : Wrap the exceptions of onFile an provide a path to the output (#121)

This is an automated email from the ASF dual-hosted git repository.

pauls pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-cpconverter.git


The following commit(s) were added to refs/heads/master by this push:
     new 1fa6255  SLING-10929 : Wrap the exceptions of onFile an provide a path to the output (#121)
1fa6255 is described below

commit 1fa6255a2f5b4f12db6ba0c2e2db22f0dd32daaf
Author: Niek Raaijmakers <ni...@gmail.com>
AuthorDate: Thu Dec 16 15:08:51 2021 +0100

    SLING-10929 : Wrap the exceptions of onFile an provide a path to the output (#121)
    
    
    Co-authored-by: Niek Raaijmakers <ra...@adobe.com>
---
 .../feature/cpconverter/ContentPackage2FeatureModelConverter.java | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/feature/cpconverter/ContentPackage2FeatureModelConverter.java b/src/main/java/org/apache/sling/feature/cpconverter/ContentPackage2FeatureModelConverter.java
index a158fa5..4ac12b7 100644
--- a/src/main/java/org/apache/sling/feature/cpconverter/ContentPackage2FeatureModelConverter.java
+++ b/src/main/java/org/apache/sling/feature/cpconverter/ContentPackage2FeatureModelConverter.java
@@ -496,7 +496,13 @@ public class ContentPackage2FeatureModelConverter extends BaseVaultPackageScanne
 
     @Override
     protected void onFile(@NotNull String entryPath, @NotNull Archive archive, @NotNull Entry entry) throws IOException, ConverterException {
-        process(entryPath, archive, entry);
+        try {
+            process(entryPath, archive, entry);
+        } catch (ConverterException ex) {
+            throw new ConverterException("ConverterException occured on path " + entryPath + " with message: " + ex.getMessage(), ex);
+        } catch (IOException ex) {
+            throw new IOException("IOException occured on path " + entryPath + " with message: " + ex.getMessage(), ex);
+        }
     }
 
     public static @NotNull ArtifactId toArtifactId(@NotNull PackageId packageId, @NotNull File file) {