Exception: Hyperb::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Hyperb::Error
- Defined in:
- lib/hyperb/error.rb
Overview
representation of Hyper errors
Direct Known Subclasses
Defined Under Namespace
Classes: UnsupportedRegion
Constant Summary collapse
- ClientError =
4xx HTTP status code
Class.new(self)
- ServerError =
5xx HTTP status code
Class.new(self)
- NotModified =
hyper uses code 304 as a server representation for some operations
Class.new(ClientError)
- BadRequest =
code 400
Class.new(ClientError)
Class.new(ClientError)
- NotFound =
code 404
Class.new(ClientError)
- Conflict =
code 409
Class.new(ClientError)
- InternalServerError =
code 500
Class.new(ServerError)
- ERRORS =
{ 304 => Hyperb::Error::NotModified, 400 => Hyperb::Error::BadRequest, 401 => Hyperb::Error::Unauthorized, 404 => Hyperb::Error::NotFound, 409 => Hyperb::Error::Conflict, 500 => Hyperb::Error::InternalServerError }.freeze
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#msg ⇒ Object
readonly
Returns the value of attribute msg.
Instance Method Summary collapse
-
#initialize(msg, code = nil) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(msg, code = nil) ⇒ Error
Returns a new instance of Error.
46 47 48 49 |
# File 'lib/hyperb/error.rb', line 46 def initialize(msg, code = nil) super(msg) @code = code end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
4 5 6 |
# File 'lib/hyperb/error.rb', line 4 def code @code end |
#msg ⇒ Object (readonly)
Returns the value of attribute msg.
4 5 6 |
# File 'lib/hyperb/error.rb', line 4 def msg @msg end |