Exception: NOWPayments::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/nowpayments/errors.rb,
lib/nowpayments.rb

Overview

Base error class for all NOWPayments errors

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env_or_message) ⇒ Error



8
9
10
11
12
13
14
15
16
17
# File 'lib/nowpayments/errors.rb', line 8

def initialize(env_or_message)
  if env_or_message.is_a?(Hash)
    @status = env_or_message[:status]
    @body = env_or_message[:body]
    @headers = env_or_message[:response_headers]
    super(error_message)
  else
    super
  end
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



6
7
8
# File 'lib/nowpayments/errors.rb', line 6

def body
  @body
end

#headersObject (readonly)

Returns the value of attribute headers.



6
7
8
# File 'lib/nowpayments/errors.rb', line 6

def headers
  @headers
end

#statusObject (readonly)

Returns the value of attribute status.



6
7
8
# File 'lib/nowpayments/errors.rb', line 6

def status
  @status
end