Exception: Typekit::ServerError

Inherits:
Error
  • Object
show all
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

Instance Method Summary collapse

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, message = '')
  @code = code
  super(message.empty? ? ERRORS[code] : message)
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



16
17
18
# File 'lib/typekit/error.rb', line 16

def code
  @code
end