5 6 7 8 9 10 11 12 13 14
# File 'lib/anzu/errors.rb', line 5 def self.raise_from_response(response) response.value rescue StandardError begin json = JSON.parse(response.body) raise Error, json['error'] rescue StandardError raise Error, response.body end end