Refactoring Salesforce responses and parsing errors when there is an exception