sailthru/sailthru-ruby-client — pull request #55 by mtowers (2014-08-28 18:18:31+00:00)
Title: Raise SailThru::ClientError when unable to parse API response

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](http://getstarted.sailthru.com/api/api-response-errors) returned in a well-formed response body.