Sha256: 49915d50a675ba78fa9a004b1567b0f42a0afdf8de5b4b00728d87d32013fcb0

Contents?: true

Size: 501 Bytes

Versions: 11

Compression:

Stored size: 501 Bytes

Contents

module Paid
  class PaidError < 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

11 entries across 11 versions & 1 rubygems

Version Path
paid-1.0.1 lib/paid/errors/paid_error.rb
paid-1.0.0 lib/paid/errors/paid_error.rb
paid-0.1.0 lib/paid/errors/paid_error.rb
paid-0.0.8 lib/paid/errors/paid_error.rb
paid-0.0.7 lib/paid/errors/paid_error.rb
paid-0.0.6 lib/paid/errors/paid_error.rb
paid-0.0.5 lib/paid/errors/paid_error.rb
paid-0.0.4 lib/paid/errors/paid_error.rb
paid-0.0.3 lib/paid/errors/paid_error.rb
paid-0.0.2 lib/paid/errors/paid_error.rb
paid-0.0.1 lib/paid/errors/paid_error.rb