Exception: TheOneApi::HttpResponseError

Inherits:
Error
  • Object
show all
Defined in:
lib/the_one_api/http_response_error.rb

Overview

Our own error class to throw for HTTP response errors

Good encapsulation to not expose our consumers to the error types of the underlying libraries unintentionally

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status, msg = nil) ⇒ HttpResponseError

Returns a new instance of HttpResponseError.



11
12
13
14
# File 'lib/the_one_api/http_response_error.rb', line 11

def initialize(status, msg = nil)
  @status = status
  super(msg)
end

Instance Attribute Details

#statusObject (readonly)

Returns the value of attribute status.



9
10
11
# File 'lib/the_one_api/http_response_error.rb', line 9

def status
  @status
end