Class: Typekit::Processing::Converter::Errors
- Inherits:
-
Object
- Object
- Typekit::Processing::Converter::Errors
- Defined in:
- lib/typekit/processing/converter/errors.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 Method Summary collapse
-
#initialize(*_) ⇒ Errors
constructor
A new instance of Errors.
- #process(response, errors) ⇒ Object
Constructor Details
#initialize(*_) ⇒ Errors
Returns a new instance of Errors.
15 16 |
# File 'lib/typekit/processing/converter/errors.rb', line 15 def initialize(*_) end |
Instance Method Details
#process(response, errors) ⇒ Object
18 19 20 |
# File 'lib/typekit/processing/converter/errors.rb', line 18 def process(response, errors) raise Error, Array(errors || ERRORS[response.code]).join(', ') end |