lib/bobot/error_parser.rb in bobot-4.9.0 vs lib/bobot/error_parser.rb in bobot-4.10.0
- old
+ new
@@ -33,16 +33,18 @@
# Raise any errors in the given response.
#
# response - A HTTParty::Response object.
#
# Returns nil if no errors were found, otherwises raises appropriately
- def raise_errors_from(response)
+ def raise_errors_from(response, extras = {})
return false unless response.key?('error')
error = response['error']
error_code = error['code']
error_subcode = error['error_subcode']
+
+ error['extras'] = extras
raise_code_only_error(error_code, error) if error_subcode.nil?
raise_code_subcode_error(error_code, error_subcode, error)