Exception: SimpleGCM::Error::BaseError
- Inherits:
-
StandardError
- Object
- StandardError
- SimpleGCM::Error::BaseError
- Defined in:
- lib/simple_gcm/error.rb
Direct Known Subclasses
AuthenticationError, InvalidRegistration, MessageTooBig, MismatchSenderId, MissingRegistration, NotRegistered, ServerUnavailable, Unkown
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #backtrace ⇒ Object
-
#initialize(ex, response = nil) ⇒ BaseError
constructor
A new instance of BaseError.
- #inspect ⇒ Object
Constructor Details
#initialize(ex, response = nil) ⇒ BaseError
Returns a new instance of BaseError.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/simple_gcm/error.rb', line 5 def initialize(ex, response = nil) @wrapped_exception = nil @response = response if ex.respond_to?(:backtrace) super(ex.) @wrapped_exception = ex elsif ex.respond_to?(:each_key) super("GCM server responded with error #{ex[:error]} and status #{ex[:status]}") @response = ex else super(ex.to_s) end end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
3 4 5 |
# File 'lib/simple_gcm/error.rb', line 3 def response @response end |
Instance Method Details
#backtrace ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/simple_gcm/error.rb', line 20 def backtrace if @wrapped_exception @wrapped_exception.backtrace else super end end |
#inspect ⇒ Object
28 29 30 |
# File 'lib/simple_gcm/error.rb', line 28 def inspect %(#<#{self.class}>) end |