Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise SailThru::UnavailableError when unable to parse API response #55

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mtowers
Copy link

@mtowers mtowers commented Aug 28, 2014

If the client fails to parse the response body, then the API is presumed to be malfunctioning and unavailable. Throw an UnavailableError including the actual response body returned.

Only return a ruby hash when a parsable response is returned from the API, including a valid error code. e.g. { 'error'=> 9 }

Values for error should only ever include valid SailThru error codes returned in a well-formed response body.

If the client fails to parse the response body, then the API is presumed to be malfunctioning and unavailable.  Throw an UnavailableError including the actual response body returned.

Only return an error body when a parsable response is returned from the API, including a valid error code.  e.g. { 'error'=> 9 }

Values for 'error' should only ever include valid SailThru error codes returned in a well-formed response body. (http://getstarted.sailthru.com/api/api-response-errors)
@mtowers mtowers changed the title Raise SailThru::ClientError when unable to parse API response Raise SailThru::UnavailableError when unable to parse API response Aug 28, 2014
@jcrivera
Copy link
Contributor

@mtowers - Your suggestion is appreciated. We'll review this PR and update you about plans to deal with the issue you raised. Thanks.

@lindsaycooper
Copy link
Contributor

@mtowers This change is not backwards compatible. We will consider making this change in a major version upgrade but for now we are going to keep it as is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants