[ 
https://issues.apache.org/jira/browse/CAMEL-10936?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Luca Burgazzoli updated CAMEL-10936:
------------------------------------
    Description: 
As per SalesforceSession's login exception handling [1] a message is computed 
to report both the error code and its description but then, when an object of 
type RestError is created, the computed message is used to set the RestError's 
code. 

IMHO, the error code provided by SalesForce should be reported as it is, then 
the computed message can be set for  RestError's message so instead of:

{code:java}
errors.add(new RestError(msg, error.getErrorDescription()));
{code}

It should be:

{code:java}
errors.add(new RestError(error.getError(), msg));
{code}

This helps to easily handle different error codes as one do not need to parse 
the error message. 

[1] 
https://github.com/apache/camel/blob/master/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/SalesforceSession.java#L199

  was:
As per SalesforceSession's login exception handling [1] a message is computed 
to report both the error code and its description but then, when an object of 
type RestError is created, the computed message is used to set the RestError's 
code. 

IMHO, the error code provided by SalesForce should be reported as it is, then 
the computed message can be set for  RestError's message so instead of:

{code:java}
errors.add(new RestError(msg, error.getErrorDescription()));
{code}

It should be:

{code:java}
errors.add(new RestError(error.getError(), msg));
{code}

[1] 
https://github.com/apache/camel/blob/master/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/SalesforceSession.java#L199


> Salesforce Login exception: the error code is not reported properly
> -------------------------------------------------------------------
>
>                 Key: CAMEL-10936
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10936
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-salesforce
>            Reporter: Luca Burgazzoli
>            Priority: Minor
>             Fix For: 2.19.0
>
>
> As per SalesforceSession's login exception handling [1] a message is computed 
> to report both the error code and its description but then, when an object of 
> type RestError is created, the computed message is used to set the 
> RestError's code. 
> IMHO, the error code provided by SalesForce should be reported as it is, then 
> the computed message can be set for  RestError's message so instead of:
> {code:java}
> errors.add(new RestError(msg, error.getErrorDescription()));
> {code}
> It should be:
> {code:java}
> errors.add(new RestError(error.getError(), msg));
> {code}
> This helps to easily handle different error codes as one do not need to parse 
> the error message. 
> [1] 
> https://github.com/apache/camel/blob/master/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/SalesforceSession.java#L199



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to