Skip to content

HTTP and protocol errors are not nicely passed through SCIM client #51

Open

Description

@smoyer64

If OAuth2 authentication fails (or requires) re-authentication during a SCIM client call ... this error should be put into a SCIMError so that the message (from the entity body) and the status code are both available to the SCIM client library user.

As noted by the title change, this actually applies to any HTTP error that does not include an entity body with the JSON for a SCIMError. In this case, the unmarshaling error should not be returned but rather the HTTP status code (and maybe message) along with the plain text from the entity body should be put into an error and returned. The incorrect code is:

	if resp.StatusCode < 200 || resp.StatusCode > 299 {
		var er ErrorResponse
		err = json.Unmarshal(body, &er)
		if err != nil {
			return err
		}
		return er
	}

Activity

  1. changed the title [-]OAuth2 errors are not nicely passed through SCIM client[/-] [+]HTTP and protocol errors are not nicely passed through SCIM client[/+] on Feb 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions