fix: surface real server error details to client console#1748
fix: surface real server error details to client console#1748MrDirkelz wants to merge 2 commits into
Conversation
Review summary — ✅ Approve
🤖 AI-assisted review summary (Claude Code). Read-only analysis of the PR diff — not a substitute for human review. |
Think we need to ensure that raw error messages are not sent to the client - only extracted string messages. |
Only forward .message when the exception is an HttpException we threw ourselves — that text is deliberately authored and safe. Anything else (a bare Error from nano, the S3 SDK, or a bug) gets a generic message instead, since its .message was never vetted for client exposure and could leak internals such as the CouchDB connection string. The real cause is still logged server-side either way. Addresses review feedback on PR #1748. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Passing through the real message for all HttpExceptions regardless of status (not just <500) removes the filter's safety net for 5xx errors. Today every HttpException in the codebase uses a hardcoded 4xx string, so this isn't exploitable yet, but nothing stops a future 5xx throw like |
The API's exception filter stripped 5xx errors down to a generic message before the client ever saw them, so the app/cms console.error calls had nothing useful to log. Send the real exception.message (never .stack) to clients in all environments; the friendly toast copy is now purely a client-side display choice, unrelated to what the server sends. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Only forward .message when the exception is an HttpException we threw ourselves — that text is deliberately authored and safe. Anything else (a bare Error from nano, the S3 SDK, or a bug) gets a generic message instead, since its .message was never vetted for client exposure and could leak internals such as the CouchDB connection string. The real cause is still logged server-side either way. Addresses review feedback on PR #1748. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
4db9f70 to
0f58c32
Compare
The API's exception filter stripped 5xx errors down to a generic message before the client ever saw them, so the app/cms console.error calls had nothing useful to log. Send the real exception.message (never .stack) to clients in all environments; the friendly toast copy is now purely a client-side display choice, unrelated to what the server sends.