-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
refactor: better observability in api routes #18810
Conversation
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details:
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
E2E results are ready! |
Graphite Automations"Add foundation team as reviewer" took an action on this PR • (01/22/25)1 reviewer was added to this PR based on Keith Williams's automation. |
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.
Amazing. Thank you for taking this over @zomars
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.
.
Co-authored-by: Keith Williams <[email protected]>
Co-authored-by: Keith Williams <[email protected]>
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
What does this PR do?
refs #18784
This pull request includes changes to improve error handling and refactor the Sentry integration in API handlers. The most important changes include moving the Sentry wrapping logic to the
defaultResponder
function and enhancing error handling for TRPC errors.Sentry Integration Refactor:
apps/web/pages/api/book/event.ts
: Removed the Sentry wrapping from thehandler
function and simplified the export statement. [1] [2]packages/lib/server/defaultResponder.ts
: Moved the Sentry wrapping logic into thedefaultResponder
function, allowing it to conditionally wrap handlers based on theendpointRoute
parameter. [1] [2]Error Handling Improvements:
packages/lib/server/getServerErrorFromUnknown.ts
: Enhanced thegetServerErrorFromUnknown
function to handle TRPC errors by mapping them to HTTP status codes and messages. [1] [2]Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Checklist