Uploaded image for project: 'OpenICF'
  1. OpenICF
  2. OPENICF-1106

JSON Error responses from Salesforce REST API are not properly handled by the Salesforce Connector

    XMLWordPrintable

    Details

      Description

      Salesforce returns well formatted JSON error responses requests to the Salesforce REST API can not be fulfilled or encounter errors.

      The Salesforce Connector should properly parse any JSON error responses received from Salesforce and set appropriate messages within ConnectorExceptions which are thrown.

      For example, the current connector implementation writes raw JSON error response as String values within the resulting ConnectorException.  These string values are not easily parsed by a UI making it difficult to present friendly error messages to users.

      Example ConnectorException message:

      Error: 400↵[{"message":"User's Profile can't be set to 'Identity User' because it's derived from a license that doesn't require the following permission(s): ChatterInternalUser. Select a different profile.","errorCode":"FIELD_INTEGRITY_EXCEPTION","fields":[]}]
      

      What is most relevant and what should be set within ConnectorException's is the message attribute within the JSON error response

        Attachments

          Activity

            People

            Assignee:
            cgdrake Chris Drake
            Reporter:
            cgdrake Chris Drake
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: