class Mollie::RequestError

Attributes

detail[RW]
field[RW]
response[RW]
status[RW]
title[RW]

Public Class Methods

new(error, response = nil) click to toggle source
# File lib/mollie/exception.rb, line 8
def initialize(error, response = nil)
  exception.status = error['status']
  exception.title  = error['title']
  exception.detail = error['detail']
  exception.field  = error['field']
  exception.links  = error['_links']
  self.response = response
end

Public Instance Methods

http_body() click to toggle source
# File lib/mollie/exception.rb, line 25
def http_body
  response.body if response
end
http_headers() click to toggle source
# File lib/mollie/exception.rb, line 21
def http_headers
  response.to_hash if response
end
to_s() click to toggle source
# File lib/mollie/exception.rb, line 17
def to_s
  "#{status} #{title}: #{detail}"
end