django-ratelimit icon indicating copy to clipboard operation
django-ratelimit copied to clipboard

Add informative parameters to 'RateLimited' Exception

Open AlonFasta opened this issue 3 years ago • 2 comments

@jsocol in order to allow proper differentiation and documentation in case of multiple rate limit decorators on a single Django view, i have added 'key', 'group' and 'rate' details to 'RateLimited' Exception, WDYT?

Thanks :)

AlonFasta avatar Nov 03 '20 17:11 AlonFasta

@jsocol Any feedback?

AlonFasta avatar Mar 03 '21 13:03 AlonFasta

Hey, I had similar idea but I would say than instead of passing individual parameters, why not pass what get_usage returns? This way people might use the additional information like time_left as part of the response.

Let me know, I can prepare a PR.

aambrozkiewicz avatar Oct 28 '22 10:10 aambrozkiewicz