stimulus-autocomplete
stimulus-autocomplete copied to clipboard
Question: Handle a 429 Response?
One of the implementations we're doing with this cool library is enabling username search. The server-side API being called has rate limits applied, and may respond with a 429 Too Many Requests error, and today the library barfs:
Uncaught (in promise) Error: Server responded with status 429
at extended.doFetch (autocomplete.js:224:1)
at async extended.fetchResults (autocomplete.js:200:1)
(Thanks for adding that in https://github.com/afcapel/stimulus-autocomplete/pull/115 ! )
The question is:
- should the library handle the response more gracefully?
- should the server-side return an empty 200 response?