Exception: Hibp::ServiceError
- Inherits:
-
StandardError
- Object
- StandardError
- Hibp::ServiceError
- Defined in:
- lib/hibp/service_error.rb
Overview
Hibp::ServiceError
Used to represent an error that may occur when performing a request to the API
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#raw_body ⇒ Object
readonly
Returns the value of attribute raw_body.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
Instance Method Summary collapse
-
#initialize(message = '', params = {}) ⇒ ServiceError
constructor
A new instance of ServiceError.
- #to_s ⇒ Object
Constructor Details
#initialize(message = '', params = {}) ⇒ ServiceError
Returns a new instance of ServiceError.
29 30 31 32 33 34 35 |
# File 'lib/hibp/service_error.rb', line 29 def initialize( = '', params = {}) @body = params[:body] @raw_body = params[:raw_body] @status_code = params[:status_code] super() end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
9 10 11 |
# File 'lib/hibp/service_error.rb', line 9 def body @body end |
#raw_body ⇒ Object (readonly)
Returns the value of attribute raw_body.
9 10 11 |
# File 'lib/hibp/service_error.rb', line 9 def raw_body @raw_body end |
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
9 10 11 |
# File 'lib/hibp/service_error.rb', line 9 def status_code @status_code end |
Instance Method Details
#to_s ⇒ Object
37 38 39 |
# File 'lib/hibp/service_error.rb', line 37 def to_s "#{super} #{instance_variables_to_s}" end |