The same try/catch -> console.log -> res.status(500)
pattern is duplicated 20+ times across agreements.ts,
crud.ts, and mcp.ts. Several console.log statements
also expose PII (req.body, contract data) and internal
details (SQL queries, stack traces) to stdout.
This issue tracks:
- Creating server/middleware/errorHandler.ts with
globalErrorHandler and asyncHandler utilities
- Refactoring all route handlers to use asyncHandler
- Removing PII-exposing console.log statements
- Replacing with structured non-leaking error logging
The same try/catch -> console.log -> res.status(500)
pattern is duplicated 20+ times across agreements.ts,
crud.ts, and mcp.ts. Several console.log statements
also expose PII (req.body, contract data) and internal
details (SQL queries, stack traces) to stdout.
This issue tracks:
globalErrorHandler and asyncHandler utilities