Skip to content

refactor: Specific error status codes#18847

Merged
zomars merged 6 commits intomainfrom
zomars/refactor-error-responder
Jan 24, 2025
Merged

refactor: Specific error status codes#18847
zomars merged 6 commits intomainfrom
zomars/refactor-error-responder

Conversation

@zomars
Copy link
Copy Markdown
Contributor

@zomars zomars commented Jan 23, 2025

What does this PR do?

This pull request includes several changes to improve error handling and status code responses in the defaultResponder and getServerErrorFromUnknown functions, as well as updates to related tests.

Error handling improvements:

Test updates:

Booking page test fix:

  • Fixes #XXXX (GitHub issue number)
  • Fixes CAL-XXXX (Linear issue number - should be visible at the bottom of the GitHub issue description)

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  • Are there environment variables that should be set?
  • What are the minimal test data to have?
  • What is expected (happy path) to have (input and output)?
  • Any other important info that could help to test that PR

Checklist

  • I haven't read the contributing guide
  • My code doesn't follow the style guidelines of this project
  • I haven't commented my code, particularly in hard-to-understand areas
  • I haven't checked if my changes generate no new warnings

@keithwillcode keithwillcode added core area: core, team members only foundation labels Jan 23, 2025
@zomars zomars added ready-for-e2e and removed core area: core, team members only foundation labels Jan 23, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 23, 2025

E2E results are ready!

@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Jan 24, 2025 6:48am
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Jan 24, 2025 6:48am

@zomars zomars marked this pull request as ready for review January 23, 2025 23:46
@graphite-app graphite-app Bot requested a review from a team January 23, 2025 23:46
// we don't want to report Bad Request errors to Sentry / console
if (!(error.statusCode >= 400 && error.statusCode < 500)) {
console.error(err);
console.error(error);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We were sending unprocessed errors to Sentry. This could cause confusion when debugging.

@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented Jan 23, 2025

Graphite Automations

"Add foundation team as reviewer" took an action on this PR • (01/23/25)

1 reviewer was added to this PR based on Keith Williams's automation.

@zomars zomars merged commit 1fd4c3f into main Jan 24, 2025
@zomars zomars deleted the zomars/refactor-error-responder branch January 24, 2025 07:09
zomars added a commit that referenced this pull request Jan 24, 2025
Signed-off-by: Omar López <zomars@me.com>

# Conflicts:
#	apps/web/playwright/booking-pages.e2e.ts
#	packages/lib/server/getServerErrorFromUnknown.ts
emrysal added a commit that referenced this pull request Jan 24, 2025
emrysal pushed a commit that referenced this pull request Jan 24, 2025
Signed-off-by: Omar López <zomars@me.com>
zomars added a commit that referenced this pull request Jan 24, 2025
@sentry
Copy link
Copy Markdown

sentry Bot commented Jan 28, 2025

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ HttpError: An error occured while querying the database. POST /api/bookings View Issue
  • ‼️ HttpError: An error occured while querying the database. DELETE /api/event-types/[id] View Issue

Did you find this useful? React with a 👍 or 👎

MuhammadAimanSulaiman pushed a commit to hit-pay/cal.com that referenced this pull request Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants