We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2214e22 commit cba9dc6Copy full SHA for cba9dc6
1 file changed
lib/buffer/core.rb
@@ -57,11 +57,11 @@ def interpret_response(response)
57
end
58
59
def handle_response_code(response)
60
- error = Hashie::Mash.new(response.body)
61
- raise Buffer::Error::APIError unless error.code
62
- "Buffer API Error Code: #{error.code}\n" +
63
- "HTTP Code: #{response.code}." +
64
- "Description: #{error.error}"
+ error = Hashie::Mash.new(JSON.parse(response.body))
+ raise Buffer::Error::APIError,
+ "Buffer API Error Code: #{error.code} " +
+ "HTTP Code: #{response.status}. " +
+ "Description: #{error.error}"
65
66
67
0 commit comments