{ "The request should be authorized." => -> { raise ::Revolut::Api::AuthorizationError.new("Authorization failed!") }, }
Returns:
11 12 13 14 15 16
# File 'lib/revolut/api/errors.rb', line 11 def error?(response) if response.is_a?(Hash) && response.has_key?("message") message = response.fetch("message", nil) ::Revolut::Api::Errors::MAPPING.fetch(message, nil)&.call end end