Exception: Cloudflare::Error

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, status: nil, body: nil) ⇒ Error

Returns a new instance of Error.

Parameters:

  • message (String, nil) (defaults to: nil)
  • status: (Integer, nil) (defaults to: nil)
  • body: (Object) (defaults to: nil)


5
6
7
8
9
# File 'lib/cloudflare/errors.rb', line 5

def initialize(message = nil, status: nil, body: nil)
  super(message_with_body(message, body))
  @status = status
  @body   = body
end

Instance Attribute Details

#body ⇒ Object (readonly)

Returns the value of attribute body.

Returns:

  • (Object)


3
4
5
# File 'lib/cloudflare/errors.rb', line 3

def body
  @body
end

#status ⇒ Integer? (readonly)

Returns the value of attribute status.

Returns:

  • (Integer, nil)


3
4
5
# File 'lib/cloudflare/errors.rb', line 3

def status
  @status
end