Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add client error endpoint to backend #819

Open
Isti01 opened this issue Oct 16, 2024 · 0 comments
Open

Add client error endpoint to backend #819

Isti01 opened this issue Oct 16, 2024 · 0 comments

Comments

@Isti01
Copy link
Collaborator

Isti01 commented Oct 16, 2024

The goal is to make it easier to detect errors on the frontend and have enough data to investigate the issue

Some fields to send that are going to be useful:

  • Error stacktrace: error.stack available when error is an Error object
  • Browser: navigator.userAgent
  • Current page: window.location.href
  • User role if available: useAuthContext().authInfo?.role

Where to detect errors?

  • Put a script tag in the head of the document and subscribe to window.onerror more on this here. The backend url can be interpolated into the script at build by Vite
  • Add error reporting to the ErrorBoundary component
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant