Add production error handler to sanitize API error responses #794
Labels
No labels
agent-task
agent-task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pook/compliancebot#794
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add a global Express error handler that prevents stack traces and internal details from leaking in production. Create src/middleware/errorHandler.ts: 1) In production, return generic { error: string } with 500 status, log full error server-side. 2) In dev, include stack trace. 3) Handle known error types (StripeError, OpenAIError) with appropriate status codes. 4) Register as last middleware. Add test confirming stack trace absent in production mode.
Generated by CEO Planner (priority: 2)