Uses Twilio::REST::RestError when a page fails to load #397
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This follows on from #391.
With the following code:
the error message looks like:
But with this change looks like:
This relies on the work done in #391 as it really just uses the
Twilio::REST::RestError
in place of theTwilio::REST::TwilioError
when it is raised in response to a non 200 status code inTwilio::REST::Page#process_response
.The rest of the work just ensures that anyone using the now defunct
body
method in theTwilio::REST::TwilioError
doesn't end up raisingNoMethodError
s instead. It no longer makes sense forTwilio::REST::TwilioError
to have a body, but since it did before this change I don't want to break anything. Read more about the actual thought process for this in the comments to #391.