class Adyen::REST::ResponseError
Exception class for error responses from the Adyen
API
.
@!attribute category
@return [String, nil]
@!attribute code
@return [Integer, nil]
@!attribute description
@return [String, nil]
Attributes
category[RW]
code[RW]
description[RW]
Public Class Methods
new(response_body)
click to toggle source
Calls superclass method
# File lib/adyen/rest/errors.rb 23 def initialize(response_body) 24 if match = /\A(\w+)\s(\d+)\s(.*)\z/.match(response_body) 25 @category, @code, @description = match[1], match[2].to_i, match[3] 26 super("API request error: #{description} (code: #{code}/#{category})") 27 else 28 super("API request error: #{response_body}") 29 end 30 end