Exception: ApnsProviderApi::Notification::APNSError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- ApnsProviderApi::Notification::APNSError
- Defined in:
- lib/apns_provider_api/notification.rb
Constant Summary collapse
- CODES =
{ 200 => "Success", 400 => "Bad request", 403 => "There was an error with the certificate", 405 => "The request used a bad :method value. Only POST requests are supported", 410 => "The device token is no longer active for the topic", 413 => "The notification payload was too large", 429 => "The server received too many requests for the same device token", 500 => "Internal server error", 503 => "The server is shutting down and unavailable" }
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Instance Method Summary collapse
-
#initialize(code) ⇒ APNSError
constructor
A new instance of APNSError.
Constructor Details
#initialize(code) ⇒ APNSError
Returns a new instance of APNSError.
22 23 24 25 26 |
# File 'lib/apns_provider_api/notification.rb', line 22 def initialize(code) raise ArgumentError unless CODES.include?(code) super(CODES[code]) @code = code end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
20 21 22 |
# File 'lib/apns_provider_api/notification.rb', line 20 def code @code end |