GUI errors are caught and sent to server
Thanks to Error boundaries and refactoring of errors on the saga side, I implemented something similar to what sentry.io is offering:
- Client side errors tracking
Indeed, Sentry is right: clients do not send you the errors they found, it is best to get them yourselves! If you want to troubleshoot easily your GUI errors, you have to know them.
So this is what I did:
Sending the client side errors
- Saga error and React error are caught globally
- Once caught they are enriched with as many metadata as I can
- Last request performed in case of Saga errors
- What React component failed in case of React errors
- A dump of current Redux state
- I reused the 'share' feature :)
- Last user action performed
- I had it from my session tracking statistics feature
- Then the log is sent to Spider server in background.
- If this sending fails, nothing is done, except console logging.
Reporting on the client side errors
As I'm already using Elasticsearch to store most resources, storing the UI logs inside was peanuts. And then, I had included them in Spider monitoring UI:
- I know how many errors were done and when
- I can browse them
- I can open them to find details and troubleshoot
Here it is a safety belt when the interval of timeLine is too small comparing to time range. I need to do something on timeline to avoid having these errors. See, it is useful! :)
- I can search for similarities
- And... I can open the user state in Spider UI and reproduce the error, just by copy pasting the link :-)
Amazing !