[Backend] Stop echoing raw error.message to clients and mislabeling 4xx as unhandled errors
Overview & Background
Two logging/response leaks: (1) error.middleware.ts:16 runs logger.error('Unhandled error:', err) unconditionally, before any classification — so handled 400s (e.g. the ZodError branch) are logged at error level as "unhandled", hiding real failures in on-call noise. (2) webhook.controller.ts:40,102,116,130,155 echoes raw exception text ({ error: error.message }) to clients — Prisma messages name models/tables — bypassing sanitizeDatabaseErrorMessage, which exists precisely to prevent that. graphql/routes.ts:56-59 similarly returns raw error.message in errors[0].message.
Technical Specification & Architecture
- Log at
warn/debugfor 4xx; reserveerrorfor 5xx. - Route webhook/GraphQL failures through
sendApiError/sanitizeDatabaseErrorMessagewith generic client messages.
Target Files
backend/src/middleware/error.middleware.tsbackend/src/controllers/webhook.controller.tsbackend/src/graphql/routes.tsbackend/src/lib/api-error.ts
Acceptance Criteria
- [ ] 4xx responses are not logged as unhandled errors.
- [ ] No raw exception text reaches clients.
- [ ] Tests assert sanitized error bodies.
@heymide has applied to work on this issue as part of the Stellar Wave Program's 11th wave.
I can take this on. I've gone through the details and will provide a well-tested solution aligned with the project standards.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @heymide to this issue.
@Aboyeji-Isaac has applied to work on this issue as part of the Stellar Wave Program's 11th wave.
Hi maintainer, I would like to work on this issue. I understand the goal is a cash-flow calendar that visualizes expected incoming and outgoing stream activity over a selectable period, correctly accounting for pauses, end dates, and uncertainty so projections are never presented as guaranteed settlement. Based on my experience building financial timeline components in React/TypeScript with careful date and timezone handling, this is how I'll resolve this issue: I will build the calendar to expand each stream's schedule across the selected range while respecting pauses and end dates, reconcile per-day summaries against existing stream detail calculations, test timezone boundaries and failure cases, label projected amounts as estimates, update the relevant documentation, and open a PR referencing
Closes #263with test results, without touching wallet authorization, chain validation, accounting invariants, or secret handling.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @Aboyeji-Isaac to this issue.
@anitahhhh has applied to work on this issue as part of the Stellar Wave Program's 11th wave.
yours is easy
ℹ️ Repo Maintainers: To accept this application, review their application or assign @anitahhhh to this issue.
Congratulations, @anitahhhh! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on November 25, 2026.
🧑💻 @anitahhhh: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
[!WARNING] When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
🌊 Happy Wave 🌊
This issue has been completed by @anitahhhh as part of the Stellar Wave Program's 11th Wave 🥳
😎 @anitahhhh: You earned 200 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.
🧑💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.