Exception: CircuitApi::HttpError
- Inherits:
-
StandardError
- Object
- StandardError
- CircuitApi::HttpError
- Defined in:
- lib/circuit_api/utils/errors.rb
Direct Known Subclasses
BadRequest, InternalServerError, ServiceUnavailable, Unauthorized
Instance Attribute Summary collapse
-
#error_body ⇒ Object
readonly
Returns the value of attribute error_body.
-
#error_code ⇒ Object
readonly
Returns the value of attribute error_code.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(code, body, uri) ⇒ HttpError
constructor
A new instance of HttpError.
- #message ⇒ Object
Constructor Details
#initialize(code, body, uri) ⇒ HttpError
Returns a new instance of HttpError.
5 6 7 8 9 |
# File 'lib/circuit_api/utils/errors.rb', line 5 def initialize(code, body, uri) @error_code = code @error_body = body @uri = uri end |
Instance Attribute Details
#error_body ⇒ Object (readonly)
Returns the value of attribute error_body.
3 4 5 |
# File 'lib/circuit_api/utils/errors.rb', line 3 def error_body @error_body end |
#error_code ⇒ Object (readonly)
Returns the value of attribute error_code.
3 4 5 |
# File 'lib/circuit_api/utils/errors.rb', line 3 def error_code @error_code end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
3 4 5 |
# File 'lib/circuit_api/utils/errors.rb', line 3 def uri @uri end |
Instance Method Details
#message ⇒ Object
11 12 13 |
# File 'lib/circuit_api/utils/errors.rb', line 11 def "HTTP #{error_code} - URI: #{uri}.\n Error: #{error_body}" end |