Exception: Notisend::TooManyRequests

Inherits:
ApiError show all
Defined in:
lib/notisend/errors.rb

Overview

429: exposes the server-suggested wait extracted from the detail text

Constant Summary

Constants inherited from ApiError

ApiError::STATUS_MAP

Instance Attribute Summary

Attributes inherited from ApiError

#errors, #status

Instance Method Summary collapse

Methods inherited from ApiError

#detail, for, #initialize

Constructor Details

This class inherits a constructor from Notisend::ApiError

Instance Method Details

#retry_afterObject



82
83
84
85
# File 'lib/notisend/errors.rb', line 82

def retry_after
  match = detail&.match(/(\d+) seconds?/)
  match && match[1].to_i
end