Exception: HyperTrack::Error
- Inherits:
-
StandardError
- Object
- StandardError
- HyperTrack::Error
- Defined in:
- lib/hypertrack/errors/hypertrack_errors.rb
Direct Known Subclasses
AccessForbidden, BadGateway, FormatNotAcceptable, GatewayTimeout, InternalServerError, InvalidAPIKey, InvalidJSONResponse, InvalidParameters, MethodNotAllowed, NoFreeCreditsLeft, RateLimitExceeded, ResourceNotFound, ResourceRemovedFromServer, ServiceTemporarilyUnavailable, UnknownError
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(message, code = nil) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(message, code = nil) ⇒ Error
Returns a new instance of Error.
24 25 26 27 |
# File 'lib/hypertrack/errors/hypertrack_errors.rb', line 24 def initialize(, code=nil) @code = code super() end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
4 5 6 |
# File 'lib/hypertrack/errors/hypertrack_errors.rb', line 4 def code @code end |
Class Method Details
.defined_codes ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/hypertrack/errors/hypertrack_errors.rb', line 6 def self.defined_codes { 400 => HyperTrack::InvalidParameters, 401 => HyperTrack::InvalidAPIKey, 402 => HyperTrack::NoFreeCreditsLeft, 403 => HyperTrack::AccessForbidden, 404 => HyperTrack::ResourceNotFound, 405 => HyperTrack::MethodNotAllowed, 406 => HyperTrack::FormatNotAcceptable, 410 => HyperTrack::ResourceRemovedFromServer, 429 => HyperTrack::RateLimitExceeded, 500 => HyperTrack::InternalServerError, 502 => HyperTrack::BadGateway, 503 => HyperTrack::ServiceTemporarilyUnavailable, 504 => HyperTrack::GatewayTimeout } end |