Exception: P8push::Notification::APNSError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/p8push/notification.rb

Constant Summary collapse

CODES =
{
  0 => 'No errors encountered',
  1 => 'Processing error',
  2 => 'Missing device token',
  3 => 'Missing topic',
  4 => 'Missing payload',
  5 => 'Invalid token size',
  6 => 'Invalid topic size',
  7 => 'Invalid payload size',
  8 => 'Invalid token',
  10 => 'Shutdown',
  255 => 'Unknown error'
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code) ⇒ APNSError

Returns a new instance of APNSError.

Raises:

  • (ArgumentError)


22
23
24
25
26
# File 'lib/p8push/notification.rb', line 22

def initialize(code)
  raise ArgumentError unless CODES.include?(code)
  super(CODES[code])
  @code = code
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



20
21
22
# File 'lib/p8push/notification.rb', line 20

def code
  @code
end