This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch camel-2.20.x in repository https://gitbox.apache.org/repos/asf/camel.git
commit c3351f9bd063bc825a23a51dbe002f9864f92f24 Author: Claus Ibsen <[email protected]> AuthorDate: Fri Feb 2 10:50:08 2018 +0100 CAMEL-12176: Include nested exception when camel-dropbox fails. --- .../camel/component/dropbox/core/DropboxAPIFacade.java | 16 ++++++++-------- .../camel/component/dropbox/util/DropboxException.java | 4 ++++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/core/DropboxAPIFacade.java b/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/core/DropboxAPIFacade.java index 7992aa1..4bfb887 100755 --- a/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/core/DropboxAPIFacade.java +++ b/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/core/DropboxAPIFacade.java @@ -96,7 +96,7 @@ public final class DropboxAPIFacade { try { entry = client.files().upload(dropboxPath); } catch (DbxException e) { - throw new DropboxException(dropboxPath + " does not exist or can't obtain metadata"); + throw new DropboxException(dropboxPath + " does not exist or cannot obtain metadata", e); } if (localPath != null) { @@ -150,7 +150,7 @@ public final class DropboxAPIFacade { // list all files in a dir Collection<File> listFiles = FileUtils.listFiles(fileLocalPath, null, true); if (listFiles.isEmpty()) { - throw new DropboxException(localPath + " doesn't contain any files"); + throw new DropboxException(localPath + " does not contain any files"); } HashMap<String, DropboxResultCode> resultMap = new HashMap<>(listFiles.size()); @@ -271,7 +271,7 @@ public final class DropboxAPIFacade { searchMatches = listing.getMatches(); return new DropboxSearchResult(searchMatches); } catch (DbxException e) { - throw new DropboxException(remotePath + " does not exist or can't obtain metadata"); + throw new DropboxException(remotePath + " does not exist or cannot obtain metadata", e); } } else { LOG.debug("Search by query: {}", query); @@ -280,7 +280,7 @@ public final class DropboxAPIFacade { searchMatches = listing.getMatches(); return new DropboxSearchResult(searchMatches); } catch (DbxException e) { - throw new DropboxException(remotePath + " does not exist or can't obtain metadata"); + throw new DropboxException(remotePath + " does not exist or cannot obtain metadata", e); } } } @@ -297,7 +297,7 @@ public final class DropboxAPIFacade { try { client.files().deleteV2(remotePath); } catch (DbxException e) { - throw new DropboxException(remotePath + " does not exist or can't obtain metadata"); + throw new DropboxException(remotePath + " does not exist or cannot obtain metadata", e); } return new DropboxDelResult(remotePath); } @@ -315,7 +315,7 @@ public final class DropboxAPIFacade { client.files().moveV2(remotePath, newRemotePath); return new DropboxMoveResult(remotePath, newRemotePath); } catch (DbxException e) { - throw new DropboxException(remotePath + " does not exist or can't obtain metadata"); + throw new DropboxException(remotePath + " does not exist or cannot obtain metadata", e); } } @@ -369,9 +369,9 @@ public final class DropboxAPIFacade { return null; } } catch (DbxException e) { - throw new DropboxException(path + " does not exist or can't obtain metadata"); + throw new DropboxException(path + " does not exist or cannot obtain metadata", e); } catch (IOException e) { - throw new DropboxException(path + " can't obtain a stream"); + throw new DropboxException(path + " cannot obtain a stream", e); } } } diff --git a/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/util/DropboxException.java b/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/util/DropboxException.java index e900fe8..b091429 100755 --- a/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/util/DropboxException.java +++ b/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/util/DropboxException.java @@ -27,4 +27,8 @@ public class DropboxException extends Exception { public DropboxException(String message) { super(message); } + + public DropboxException(String message, Throwable cause) { + super(message, cause); + } } -- To stop receiving notification emails like this one, please contact [email protected].
