Exception: Rpush::TooManyRequestsError
- Inherits:
-
StandardError
- Object
- StandardError
- Rpush::TooManyRequestsError
- Defined in:
- lib/rpush/daemon/too_many_requests_error.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(code, notification_id, description, response) ⇒ TooManyRequestsError
constructor
A new instance of TooManyRequestsError.
- #message ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(code, notification_id, description, response) ⇒ TooManyRequestsError
Returns a new instance of TooManyRequestsError.
5 6 7 8 9 10 |
# File 'lib/rpush/daemon/too_many_requests_error.rb', line 5 def initialize(code, notification_id, description, response) @code = code @notification_id = notification_id @description = description @response = response end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
3 4 5 |
# File 'lib/rpush/daemon/too_many_requests_error.rb', line 3 def code @code end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
3 4 5 |
# File 'lib/rpush/daemon/too_many_requests_error.rb', line 3 def description @description end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
3 4 5 |
# File 'lib/rpush/daemon/too_many_requests_error.rb', line 3 def response @response end |
Instance Method Details
#message ⇒ Object
16 17 18 |
# File 'lib/rpush/daemon/too_many_requests_error.rb', line 16 def "Too many requests for #{@notification_id}, received error #{@code} (#{@description}) - retry after #{@response.header['retry-after']}" end |
#to_s ⇒ Object
12 13 14 |
# File 'lib/rpush/daemon/too_many_requests_error.rb', line 12 def to_s end |