Exception: Cerberus::Exception::HttpError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/cerberus/exception/http_error.rb

Overview

Custom exception raised when an HTTP exception is raised but we want to handle it differently than simply presenting it to the end-user

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(httpMsg, responseObj = nil) ⇒ HttpError

Init with exception message and response object if one is available



16
17
18
19
20
21
# File 'lib/cerberus/exception/http_error.rb', line 16

def initialize(httpMsg, responseObj = nil)

  @response = responseObj
  super("An error occurred executing the HTTP request: #{httpMsg}")

end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



11
12
13
# File 'lib/cerberus/exception/http_error.rb', line 11

def response
  @response
end