Exception: BlockGiven::HttpError

Inherits:
Error
  • Object
show all
Defined in:
lib/block_given/errors.rb

Overview

Transport-level failure (non-2xx HTTP status, connection refused, ...).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, status: nil, body: nil) ⇒ HttpError

Returns a new instance of HttpError.



22
23
24
25
26
# File 'lib/block_given/errors.rb', line 22

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

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



20
21
22
# File 'lib/block_given/errors.rb', line 20

def body
  @body
end

#statusObject (readonly)

Returns the value of attribute status.



20
21
22
# File 'lib/block_given/errors.rb', line 20

def status
  @status
end