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

feat(engine): Suppress stack traces using catch-all handler #126

Merged
merged 1 commit into from
May 3, 2024

Conversation

daryllimyt
Copy link
Contributor

@daryllimyt daryllimyt commented May 3, 2024

Motivation

We had a user report that sending a malformed paylaod returned a user-facing stacktrace. In order to suppress this, we can add a catch-all exception handler for our public api endpoints

Example behavior

Before

❯ curl -X POST "https://REDACTED.ngrok-free.app/webhook/REDACTED" -H "Content-type: application/json"
Internal Server Error

After

❯ curl -X POST "https://REDACTED.ngrok-free.app/webhook/REDACTED"" -H "Content-type: application/json"
{"message":"An unexpected error occurred. Please try again later."}

With the change, return a well-formed http response

@daryllimyt daryllimyt self-assigned this May 3, 2024
Copy link

vercel bot commented May 3, 2024

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

Name Status Preview Comments Updated (UTC)
tracecat ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 3, 2024 11:39pm

@daryllimyt daryllimyt requested a review from topher-lo May 3, 2024 23:14
@daryllimyt daryllimyt added engine Improvements or additions to the workflow engine fix Bug fix labels May 3, 2024
@daryllimyt daryllimyt force-pushed the feat/add-catch-all-fastapi-exception-handler branch from 275162e to e1b9484 Compare May 3, 2024 23:36
@daryllimyt daryllimyt merged commit b8a6deb into main May 3, 2024
1 of 2 checks passed
@daryllimyt daryllimyt deleted the feat/add-catch-all-fastapi-exception-handler branch May 3, 2024 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engine Improvements or additions to the workflow engine fix Bug fix
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

1 participant