Exception: Listmonk::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/listmonk/errors.rb,
sig/listmonk.rbs

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, response: nil) ⇒ Error

Returns a new instance of Error.



7
8
9
10
# File 'lib/listmonk/errors.rb', line 7

def initialize(message = nil, response: nil)
  @response = response
  super(message)
end

Instance Attribute Details

#responseResponse? (readonly)

Returns the value of attribute response.

Returns:



5
6
7
# File 'lib/listmonk/errors.rb', line 5

def response
  @response
end

Instance Method Details

#bodyObject

Returns:

  • (Object)


16
17
18
# File 'lib/listmonk/errors.rb', line 16

def body
  response&.body
end

#statusInteger?

Returns:

  • (Integer, nil)


12
13
14
# File 'lib/listmonk/errors.rb', line 12

def status
  response&.status
end