Exception: Typekit::ServerError
- Defined in:
- lib/typekit/error.rb
Constant Summary collapse
- ERRORS =
{ 400 => 'There are errors in the data provided by your application', 401 => 'Authentication is needed to access the requested endpoint', 403 => 'Your application has been rate limited', 404 => 'You are requesting a resource that does not exist', 500 => 'The servers of Typekit are unable to process the request', 503 => 'The Typekit API is offline for maintenance' }
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Instance Method Summary collapse
-
#initialize(code, message = '') ⇒ ServerError
constructor
A new instance of ServerError.
Constructor Details
#initialize(code, message = '') ⇒ ServerError
Returns a new instance of ServerError.
18 19 20 21 |
# File 'lib/typekit/error.rb', line 18 def initialize(code, = '') @code = code super(.empty? ? ERRORS[code] : ) end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
16 17 18 |
# File 'lib/typekit/error.rb', line 16 def code @code end |