OpenVAA / voting-advice-application

An open-source platform for creating Voting Advice Applications (VAAs)
https://openvaa.org/en
GNU General Public License v3.0
10 stars 0 forks source link

feat: runtime error logging #533

Open kaljarv opened 4 months ago

kaljarv commented 4 months ago

It'd be nice to also catch unexpected errors on CSR.

See also

kaljarv commented 3 months ago
norppaa commented 3 months ago

Running things in the same container is possible though not necessarily a good practise as it might lead to conflicts or performance issues. Docker docs

Client errors can be intercepted using with for example the js functions window.onerror and window.onunhandlerejection or try-catch-finally blocks and afterwards sending them to the backend to be logged. Logging can be done manually or using libraries such as winston or pino. An API route also needs to be implemented to receive error details from the client.

Sending user information to the backend requires consent from the user.

Do we need error boundaries to contain errors in a single component so that the whole app does not crash? This is not implemented by svelte.

One discussion about error handling with hooks

kaljarv commented 3 months ago

Next, try this out in a simple model which only counts errors per route (and saves generic data, such as user agent).