shrinish123 / lets-Upsolve

A web app to assist you with upsolving Coding contests on codeforces practice for the future contests to get better and improve performance ,and also get insights and Analysis of your current performance on codeforces.
https://letsupsolve.netlify.app
5 stars 10 forks source link

Add Error Handling in the frontend #18

Open shrinish123 opened 1 year ago

shrinish123 commented 1 year ago

So right now whenever we make an API request , and if we might face an error the only thing done is that we console.log the error , which is bad with respect to user perspective. I would suggest to have a npm package and to show errors properly if anything goes wrong

MaYaNkKashyap681 commented 1 year ago

can I work on this issue?

shrinish123 commented 1 year ago

Yes you can go ahead, would recommend you to use React Toastify to show the errors and also success messages if any. don't show success messages like data got loaded etc, only if there's error fetching data you can say something like Something went wrong, etc. Also if you get success response we need to check if the status is ok or failed. Like lets say someone enters a nonexistent codeforces handle it will return a successful response as shown in the image below :

erorrhandling

So what we need to check is also if the status is ok or failed, (even after we get a successful response ) and if the status is failed add a error message where the message can be simply the same that we get from the response as shown in the above image

shrinish123 commented 1 year ago

I would assign this to you, just please give me a date for your 1st PR submission, it doesn't need to complete implementation, just a small part to track your progress and that would be good.

MaYaNkKashyap681 commented 1 year ago

I would assign this to you, just please give me a date for your 1st PR submission, it doesn't need to complete implementation, just a small part to track your progress and that would be good.

16 Dec 2022.