Sha256: 7affed40e36ffe41319bd31dbb921e88b1fa9c057e40b5801517ea8be92abf8f

Contents?: true

Size: 507 Bytes

Versions: 3

Compression:

Stored size: 507 Bytes

Contents

module Conekta
  class ConektaError < 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

3 entries across 3 versions & 1 rubygems

Version Path
conekta-0.3.3 lib/conekta/errors/conekta_error.rb
conekta-0.3.1 lib/conekta/errors/conekta_error.rb
conekta-0.3.0 lib/conekta/errors/conekta_error.rb