camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zregv...@apache.org
Subject [2/2] camel git commit: CAMEL-10936 Salesforce Login exception: the err...
Date Fri, 24 Mar 2017 14:59:04 GMT
CAMEL-10936 Salesforce Login exception: the err...

...or code is not reported properly

RestError's `errorCode` is now set from the `error` property of the
LoginError.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f7d30c8e
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f7d30c8e
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f7d30c8e

Branch: refs/heads/master
Commit: f7d30c8ea01afddbb7ccd989ceea571f68d19218
Parents: 803e37d
Author: Zoran Regvart <zregvart@apache.org>
Authored: Thu Mar 23 13:08:44 2017 +0100
Committer: Zoran Regvart <zregvart@apache.org>
Committed: Fri Mar 24 15:58:12 2017 +0100

----------------------------------------------------------------------
 .../camel/component/salesforce/internal/SalesforceSession.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/f7d30c8e/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/SalesforceSession.java
----------------------------------------------------------------------
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/SalesforceSession.java
b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/SalesforceSession.java
index 33d8ddf..190de11 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/SalesforceSession.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/SalesforceSession.java
@@ -263,10 +263,11 @@ public class SalesforceSession implements Service {
             case HttpStatus.BAD_REQUEST_400:
                 // parse the response to get error
                 final LoginError error = objectMapper.readValue(responseContent, LoginError.class);
+                final String errorCode = error.getError();
                 final String msg = String.format("Login error code:[%s] description:[%s]",
error.getError(),
                     error.getErrorDescription());
                 final List<RestError> errors = new ArrayList<RestError>();
-                errors.add(new RestError(msg, error.getErrorDescription()));
+                errors.add(new RestError(errorCode, msg));
                 throw new SalesforceException(errors, HttpStatus.BAD_REQUEST_400);
 
             default:


Mime
View raw message