Describe the bug
While using the library to collect metadata about events/errors, due to the volume of requests easily exceeding the rate limits, I hit the rate limits often. The documentation for the API indicates that the responses will have two headers indicating the number of maximum requests per minute, and the time left to make another request within the next rate limiting window. These headers are not present on the Bugsnag::Api::RateLimitExceeded exception, making it hard to adequately handle retries.
Steps to reproduce
- Use the
bugsnag-api gem.
- Make any request via the library enough times.
- Receive
Bugsnag::Api::RateLimitExceeded exception.
- It only has the following methods:
[:detailed_message, :backtrace, :backtrace_locations, :set_backtrace, :cause, :full_message, :message, :exception]
None of these contain rate limiting information.
Environment
Example code snippet
Bugsnag::Api.error_events(project_id, error_id).each do |event|
begin
metadata = Bugsnag::Api.event(project_id, event.id).metaData
pp metadata
rescue Bugsnag::Api::RateLimitExceeded => e
puts "Rate limit exceeded, sleeping..."
sleep 60
retry
end
end
Error messages:
#<Bugsnag::Api::RateLimitExceeded: GET https://api.bugsnag.com/projects/xxxxevents/xxxx: 429 - >
Describe the bug
While using the library to collect metadata about events/errors, due to the volume of requests easily exceeding the rate limits, I hit the rate limits often. The documentation for the API indicates that the responses will have two headers indicating the number of maximum requests per minute, and the time left to make another request within the next rate limiting window. These headers are not present on the
Bugsnag::Api::RateLimitExceededexception, making it hard to adequately handle retries.Steps to reproduce
bugsnag-apigem.Bugsnag::Api::RateLimitExceededexception.None of these contain rate limiting information.
Environment
Example code snippet
Error messages: