Exception: Mollie::RequestError

Inherits:
Exception
  • Object
show all
Defined in:
lib/mollie/exception.rb

Direct Known Subclasses

ResourceNotFoundError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error) ⇒ RequestError

Returns a new instance of RequestError.



8
9
10
11
12
13
14
# File 'lib/mollie/exception.rb', line 8

def initialize(error)
  exception.status = error['status']
  exception.title  = error['title']
  exception.detail = error['detail']
  exception.field  = error['field']
  exception.links  = error['_links']
end

Instance Attribute Details

#detailObject

Returns the value of attribute detail.



6
7
8
# File 'lib/mollie/exception.rb', line 6

def detail
  @detail
end

#fieldObject

Returns the value of attribute field.



6
7
8
# File 'lib/mollie/exception.rb', line 6

def field
  @field
end

Returns the value of attribute links.



6
7
8
# File 'lib/mollie/exception.rb', line 6

def links
  @links
end

#statusObject

Returns the value of attribute status.



6
7
8
# File 'lib/mollie/exception.rb', line 6

def status
  @status
end

#titleObject

Returns the value of attribute title.



6
7
8
# File 'lib/mollie/exception.rb', line 6

def title
  @title
end

Instance Method Details

#to_sObject



16
17
18
# File 'lib/mollie/exception.rb', line 16

def to_s
  "#{status} #{title}: #{detail}"
end