Sha256: 1e5588651ce671d9127a01e0e759a06f01de32e5a4acca43ae9b6df61930737c

Contents?: true

Size: 463 Bytes

Versions: 15

Compression:

Stored size: 463 Bytes

Contents

module Mollie
  class Exception < StandardError
  end

  class RequestError < Mollie::Exception
    attr_accessor :status, :title, :detail, :field, :links

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

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

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
mollie-api-ruby-4.6.2 lib/mollie/exception.rb
mollie-api-ruby-4.6.1 lib/mollie/exception.rb
mollie-api-ruby-4.6.0 lib/mollie/exception.rb
mollie-api-ruby-4.5.0 lib/mollie/exception.rb
mollie-api-ruby-4.4.1 lib/mollie/exception.rb
mollie-api-ruby-4.4.0 lib/mollie/exception.rb
mollie-api-ruby-4.3.1 lib/mollie/exception.rb
mollie-api-ruby-4.3.0 lib/mollie/exception.rb
mollie-api-ruby-4.2.0 lib/mollie/exception.rb
mollie-api-ruby-4.1.5 lib/mollie/exception.rb
mollie-api-ruby-4.1.4 lib/mollie/exception.rb
mollie-api-ruby-4.1.3 lib/mollie/exception.rb
mollie-api-ruby-4.1.2 lib/mollie/exception.rb
mollie-api-ruby-4.1.1 lib/mollie/exception.rb
mollie-api-ruby-4.1.0 lib/mollie/exception.rb