Exception: Html2img::RateLimitError

Inherits:
Error
  • Object
show all
Defined in:
lib/html2img/errors.rb

Overview

Raised on a 429: too many requests, or a plan quota was exceeded.

Instance Attribute Summary

Attributes inherited from Error

#error_code, #payload, #status_code

Instance Method Summary collapse

Methods inherited from Error

#initialize, #to_s

Constructor Details

This class inherits a constructor from Html2img::Error

Instance Method Details

#retry_afterInteger?

Returns seconds to wait before retrying, when supplied.

Returns:

  • (Integer, nil)

    seconds to wait before retrying, when supplied



71
72
73
74
75
# File 'lib/html2img/errors.rb', line 71

def retry_after
  value = payload["retry_after"]

  value.is_a?(Integer) ? value : nil
end