Sha256: 258e865a3f60e67158573d3f9ecd8cfecb7f24df82aa188e7aa69a659bd1c945

Contents?: true

Size: 320 Bytes

Versions: 2

Compression:

Stored size: 320 Bytes

Contents

module Sesame
  class Error < StandardError
    attr_reader :status, :code

    def initialize(status, data)
      super(data['message'])
      @data = data
      @status = status
      @code = data['code'].to_i
    end

    def to_s
      %(#{@data['message']} HTTP: #{status}, API: #{@data['code']})
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sesame-ruby-0.1.2 lib/sesame/error.rb
sesame-ruby-0.1.1 lib/sesame/error.rb