Exception: Houston::Notification::APNSError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/houston/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)


23
24
25
26
27
# File 'lib/houston/notification.rb', line 23

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.



21
22
23
# File 'lib/houston/notification.rb', line 21

def code
  @code
end