Exception: Boltless::Errors::RequestError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/boltless/errors/request_error.rb

Overview

A generic request error wrapper, from the low-level http.rb gem

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, response: nil) ⇒ Errors::RequestError

Create a new generic request error instance.

Parameters:

  • message (String)

    the error message

  • response (HTTP::Response, nil) (defaults to: nil)

    the HTTP response, or nil when not available



17
18
19
20
21
# File 'lib/boltless/errors/request_error.rb', line 17

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

Instance Attribute Details

#messageObject

We allow to read our details



8
9
10
# File 'lib/boltless/errors/request_error.rb', line 8

def message
  @message
end

#responseObject (readonly)

Returns the value of attribute response.



9
10
11
# File 'lib/boltless/errors/request_error.rb', line 9

def response
  @response
end