-
Notifications
You must be signed in to change notification settings - Fork 7k
Better error logging in posthog #6346
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
Conversation
This commit adds centralized error logging to PostHog for all errors displayed in the frontend, whether through toasts or in the chat window. Changes include: - New error-handler.ts utility for centralized error handling and logging - Comprehensive test coverage for error logging functionality - Integration with existing error display mechanisms - Consistent metadata handling for better error tracking Resolves #6344
This commit adds centralized error logging to PostHog for all errors displayed in the frontend, whether through toasts or in the chat window. Changes include: - New error-handler.ts utility for centralized error handling and logging - Comprehensive test coverage for error logging functionality - Integration with existing error display mechanisms - Consistent metadata handling for better error tracking Resolves #6344
Since I cannot push to this branch, I've PR'd to it in #6641 with some small changes. |
frontend/src/utils/error-handler.ts
Outdated
}: ErrorDetails) { | ||
logError({ message, source, metadata }); | ||
toast.custom((t: { id: string }) => | ||
_jsx(ErrorToast, { id: t.id, error: message }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I tried this the styling didn't work, so my PR suggestion reverts this to the current behavior, toast.error(...)
, and we can change the display later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! We may have more areas to track errors but this seems like a great start!
Co-authored-by: openhands <[email protected]> Co-authored-by: Ray Myers <[email protected]>
Co-authored-by: openhands <[email protected]> Co-authored-by: Ray Myers <[email protected]>
Co-authored-by: openhands <[email protected]> Co-authored-by: Ray Myers <[email protected]>
End-user friendly description of the problem this fixes or functionality that this introduces
Add comprehensive error logging to PostHog
Give a summary of what the PR does, explaining any non-trivial design decisions
This commit adds centralized error logging to PostHog for all errors displayed in the frontend, whether through toasts or in the chat window. Changes include:
Link of any specific issues this addresses
Resolves #6344
To run this PR locally, use the following command: