Sha256: 7ff34a1d3954f36169c7de72b67f646f79c57131f26378f4646ec5dc2276713a

Contents?: true

Size: 505 Bytes

Versions: 1

Compression:

Stored size: 505 Bytes

Contents

module Paysio
  class PaysioError < 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

1 entries across 1 versions & 1 rubygems

Version Path
paysio-1.0.0 lib/paysio/errors/paysio_error.rb