manulera / ShareYourCloning_frontend

The frontend application for ShareYourCloning
MIT License
1 stars 4 forks source link

Add error pages to developing and production site #223

Open dgruano opened 1 month ago

dgruano commented 1 month ago

When the backend gives an error, the frontend turns white and nothing else is displayed. This can be a bit frightening for end users. I suggest we catch this and we add a custom error page with a funny joke and the classical option to submit the error info to the developers. This could even be automated (e.g. send an email or create an issue from the frontend/backend).

Also, it may be a good idea to save the last "stable" version of the data model so that users do not lose the progress if a rare error occurs. I don't know if this is challenging to achieve (we can also open a separate issue).

Moreover, for us, developers, it would be great to have some additional debugging info when this happens! I am thinking of the kind of error page that Django servers give. How can we do this? Do you have any other way to debug?

manulera commented 1 month ago

Hey @dgruano what kind of error are you thinking about? If you mean the one you mentioned in https://github.com/manulera/ShareYourCloning_backend/issues/177, this error happened in the frontend (see the commit with the fix)

I think I am catching every possible error coming from the backend server and displaying an error in the UI (e.g. when you provide a wrong identifier for a repository, etc.).

When the screen turns white, the error is always in the javascript as far as I can tell. It may be due to an uncaught error in an awaited request to the backend, that then translates into a javascript error.

dgruano commented 1 month ago

Sorry, my bad. As you say this error and others that I got in the past (see #124) are frontend errors. So I'll rephrase! Do you think we can add an error page to catch front-end errors?

manulera commented 1 month ago

I am not sure how to do that, to be honest. Maybe an error can be caught across the whole page and if so show something, but I don't know how to do it top of my head.

I agree that the white screen is the worst outcome! There must be something out there, if you figure it out, happy to implement it.