Exception: SmartHR::Error
- Inherits:
-
StandardError
- Object
- StandardError
- SmartHR::Error
- Defined in:
- lib/smarthr.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#error_response ⇒ Object
readonly
Returns the value of attribute error_response.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(message, status = nil, error_response = nil) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(message, status = nil, error_response = nil) ⇒ Error
Returns a new instance of Error.
15 16 17 18 19 |
# File 'lib/smarthr.rb', line 15 def initialize(, status = nil, error_response = nil) @status = status @error_response = error_response super() end |
Instance Attribute Details
#error_response ⇒ Object (readonly)
Returns the value of attribute error_response.
13 14 15 |
# File 'lib/smarthr.rb', line 13 def error_response @error_response end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
12 13 14 |
# File 'lib/smarthr.rb', line 12 def status @status end |
Class Method Details
.from_response(status, body) ⇒ Object
8 9 10 |
# File 'lib/smarthr.rb', line 8 def self.from_response(status, body) APIConnectionError.new("Invalid response #{body.to_hash} (status: #{status})") end |