Sha256: 6c7a6c73b69210029195361a9771de62e252af18b7506f20168b86dbc9fae302

Contents?: true

Size: 511 Bytes

Versions: 13

Compression:

Stored size: 511 Bytes

Contents

module Payjp
  class PayjpError < StandardError
    attr_reader :message
    attr_reader :http_status
    attr_reader :http_body
    attr_reader :json_body

    def initialize(message = nil, http_status = nil, http_body = nil, json_body = nil)
      @message = message
      @http_status = http_status
      @http_body = http_body
      @json_body = json_body
    end

    def to_s
      status_string = @http_status.nil? ? "" : "(Status #{@http_status}) "
      "#{status_string}#{@message}"
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
payjp-0.0.16 lib/payjp/errors/payjp_error.rb
payjp-0.0.14 lib/payjp/errors/payjp_error.rb
payjp-0.0.13 lib/payjp/errors/payjp_error.rb
payjp-0.0.12 lib/payjp/errors/payjp_error.rb
payjp-0.0.10 lib/payjp/errors/payjp_error.rb
payjp-0.0.9 lib/payjp/errors/payjp_error.rb
payjp-0.0.8 lib/payjp/errors/payjp_error.rb
payjp-0.0.7 lib/payjp/errors/payjp_error.rb
payjp-0.0.6 lib/payjp/errors/payjp_error.rb
payjp-0.0.5 lib/payjp/errors/payjp_error.rb
payjp-0.0.4 lib/payjp/errors/payjp_error.rb
payjp-0.0.3 lib/payjp/errors/payjp_error.rb
payjp-0.0.2 lib/payjp/errors/payjp_error.rb