Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
-
Unknown
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:
errors.add(new RestError(msg, error.getErrorDescription()));
It should be:
errors.add(new RestError(error.getError(), msg));
This helps to easily handle different error codes as one do not need to parse the error message.