mirror of
https://github.com/samsonjs/instapaper.git
synced 2026-04-27 14:57:44 +00:00
always parse as JSON
This commit is contained in:
parent
1da5c72eda
commit
96490cc9db
1 changed files with 2 additions and 2 deletions
|
|
@ -54,7 +54,7 @@ module Instapaper
|
||||||
end
|
end
|
||||||
|
|
||||||
def fail_if_error_unparseable_response(response)
|
def fail_if_error_unparseable_response(response)
|
||||||
response.parse
|
response.parse(:json)
|
||||||
rescue JSON::ParserError
|
rescue JSON::ParserError
|
||||||
raise Instapaper::Error::ServiceUnavailableError
|
raise Instapaper::Error::ServiceUnavailableError
|
||||||
end
|
end
|
||||||
|
|
@ -74,7 +74,7 @@ module Instapaper
|
||||||
|
|
||||||
def parsed_response(response)
|
def parsed_response(response)
|
||||||
@parsed_response ||= begin
|
@parsed_response ||= begin
|
||||||
response.parse
|
response.parse(:json)
|
||||||
rescue
|
rescue
|
||||||
response.body
|
response.body
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue