Skip to content

Add request url to exception payload to enable tracking in sentry #492

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

antonydenyer
Copy link
Contributor

Add additonal informatinon to errors to help with error tracking

@antonydenyer antonydenyer requested a review from a team as a code owner January 8, 2025 15:06
@@ -200,6 +200,7 @@ export async function handleFetch(request: string, options?: RequestInit) {
console.log(`response`, response);
throw new Error(
`Fetch error:${JSON.stringify({
request,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dynamic data in error messages has been difficult to work with in the past. It makes it easy to accidentally introduce PII, and it's bad for error grouping on Sentry (each unique message pops up as a separate issue). I'd strongly recommend looking for another solution.

If there is a particular network request / failure case you want more information about, I'd recommend catching there instead and capturing a more detailed exception. This fetch function is used in a variety of places

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants