Exception: Rpush::RetryableError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/rpush/daemon/retryable_error.rb

Direct Known Subclasses

RateLimitError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, notification_id, description, response) ⇒ RetryableError

Returns a new instance of RetryableError.


5
6
7
8
9
10
# File 'lib/rpush/daemon/retryable_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

#codeObject (readonly)

Returns the value of attribute code


3
4
5
# File 'lib/rpush/daemon/retryable_error.rb', line 3

def code
  @code
end

#descriptionObject (readonly)

Returns the value of attribute description


3
4
5
# File 'lib/rpush/daemon/retryable_error.rb', line 3

def description
  @description
end

#responseObject (readonly)

Returns the value of attribute response


3
4
5
# File 'lib/rpush/daemon/retryable_error.rb', line 3

def response
  @response
end

Instance Method Details

#messageObject


16
17
18
# File 'lib/rpush/daemon/retryable_error.rb', line 16

def message
  "Retryable error for #{@notification_id}, received error #{@code} (#{@description}) - retry after #{@response.header['retry-after']}"
end

#to_sObject


12
13
14
# File 'lib/rpush/daemon/retryable_error.rb', line 12

def to_s
  message
end