camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [camel] 07/11: Lets avoid printing null reason as users may think its from a NPE exception.
Date Mon, 08 Jan 2018 10:20:53 GMT
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 05f07b5bf41c7841555b9e3dd450175572a32c5c
Author: Claus Ibsen <claus.ibsen@gmail.com>
AuthorDate: Sun Jan 7 15:09:55 2018 +0100

    Lets avoid printing null reason as users may think its from a NPE exception.
---
 .../camel/component/file/GenericFileOperationFailedException.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileOperationFailedException.java
b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileOperationFailedException.java
index 5f31e98..c4b2a7b 100644
--- a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileOperationFailedException.java
+++ b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileOperationFailedException.java
@@ -42,13 +42,13 @@ public class GenericFileOperationFailedException extends RuntimeCamelException
{
     }
 
     public GenericFileOperationFailedException(int code, String reason) {
-        super("File operation failed: " + reason + ". Code: " + code);
+        super("File operation failed" + (reason != null ? ": " + reason : "") + ". Code:
" + code);
         this.code = code;
         this.reason = reason;
     }
 
     public GenericFileOperationFailedException(int code, String reason, Throwable cause)
{
-        super("File operation failed: " + reason + ". Code: " + code, cause);
+        super("File operation failed" + (reason != null ? ": " + reason : "") + ". Code:
" + code, cause);
         this.code = code;
         this.reason = reason;
     }

-- 
To stop receiving notification emails like this one, please contact
"commits@camel.apache.org" <commits@camel.apache.org>.

Mime
View raw message