sadanandpai / frontend-mini-challenges

Collection of frontend challenges for learning and interviews
https://sadanandpai.github.io/frontend-mini-challenges/
MIT License
1.96k stars 483 forks source link

Better error handling in Autocomplete (online) challenge #330

Closed kan-ish closed 8 months ago

kan-ish commented 8 months ago

Framework/code-stack

React

Scope

Autocomplete (online)

Description

Why better error handling

Screenshots

Screenshot 2023-11-07 at 02 01 22 Screenshot 2023-11-07 at 02 03 26

Additional Context

Suggesstion

When the rate limit is breached, the API responds with the epoch time at which we can start making requests again. This is under the "x-ratelimit-reset" header. This can be used to convey to the user the actual problem, and how soon can they start making requests again. This would be much better than showing the message "No results found" for a perfectly valid username.

kan-ish commented 8 months ago

@sadanandpai @arpansaha13 Let me know if this issue is open-worthy, and if this feature can add value to the project. I have some commits ready and I can create a PR asap.