Repository navigation
feat(api): machine-readable error codes and error catalogue - #192
agba-marvel wants to merge 6 commits into
Conversation
|
@agba-marvel Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
@agba-marvel This PR now has merge conflicts with git fetch upstream # upstream = https://github.com/DocForum/docforum-core.git
git rebase upstream/main
# resolve the conflicts, re-run the tests, then:
git push --force-with-leaseThe usual culprits are shared files like Automated message. It won't repeat unless the PR conflicts again after your next push. |
|
@agba-marvel CI is failing on this branch, so it can't be merged yet. The errors from the latest run: Backend (typecheck + test + build) Please reproduce this locally, fix the errors above and push. CI will re-run on your next push. This PR also has merge conflicts with |
|
@agba-marvel This PR now has merge conflicts with git fetch upstream # upstream = https://github.com/DocForum/docforum-core.git
git rebase upstream/main
# resolve the conflicts, re-run the tests, then:
git push --force-with-leaseThe usual culprits are shared files like Automated message. It won't repeat unless the PR conflicts again after your next push. |
|
@agba-marvel CI is failing on this branch against the latest Backend (typecheck + test + build) Reproduce this locally on the latest This PR also conflicts with |
|
@agba-marvel This PR now has merge conflicts with git fetch upstream # upstream = https://github.com/DocForum/docforum-core.git
git rebase upstream/main
# resolve the conflicts, re-run the tests, then:
git push --force-with-leaseThe usual culprits are shared docs like Automated message. It won't repeat unless the PR conflicts again after your next push. |
|
@agba-marvel CI is failing on this branch against the latest Backend (typecheck + test + build) Reproduce this locally on the latest This PR also conflicts with |
|
@afeezorobsco-cyber — this PR is ready for another review. I resolved the merge conflicts with the main branch (pushed 1916d7d). |
|
@agba-marvel This PR now has merge conflicts with git fetch upstream # upstream = https://github.com/DocForum/docforum-core.git
git rebase upstream/main
# resolve the conflicts, re-run the tests, then:
git push --force-with-leaseThe usual culprits are shared docs like Automated message. It won't repeat unless the PR conflicts again after your next push. |
|
@agba-marvel CI is failing on this branch against the latest Backend (typecheck + test + build)
This PR also conflicts with |
|
@agba-marvel fix CI failure |
|
@agba-marvel This PR now has merge conflicts with git fetch upstream # upstream = https://github.com/DocForum/docforum-core.git
git rebase upstream/main
# resolve the conflicts, re-run the tests, then:
git push --force-with-leaseThe usual culprits are shared docs like Automated message. It won't repeat unless the PR conflicts again after your next push. |
|
@agba-marvel The only CI failure on your latest run is the This PR also conflicts with git fetch upstream
git rebase upstream/main
# fix the conflicts, then
git push --force-with-lease |
|
@afeezorobsco-cyber — this PR is ready for another review. I resolved the merge conflicts with the main branch (pushed 01a20c6). |
|
@agba-marvel CI is failing at
|
Overview
This PR introduces machine-readable error codes across the backend error envelope.
HttpErrorand the error handler now emit{ code, message, details? }so clients can branch on stable codes instead of string-matching messages, whilemessageis preserved for backwards compatibility. Existing thrown errors in the appointments and payments services are converted to coded errors, and the roadmap is updated to reflect progress.Related Issue
Changes
🏷️ Error Envelope & Codes
[MODIFY]
backend/src/http-error.tsHttpErrorto carry acodealongsidemessage(and optionaldetails).SLOT_TAKEN,EMAIL_NOT_VERIFIED,WALLET_NOT_LINKED).[MODIFY]
backend/src/middleware/error-handler.ts{ code, message, details? }envelope.VALIDATION_FAILEDcode with field-leveldetails.INTERNALfor unknown errors without leaking internals.🔁 Converted Thrown Errors
[MODIFY]
backend/src/modules/appointments/services/index.tsHttpErrorconstructions with coded equivalents (e.g. slot-taken path).[MODIFY]
backend/src/modules/payments/services/index.tsHttpErrorconstructions with coded equivalents.📚 Docs
ROADMAP.mdVerification Results
HttpErrorand error handler emit{ code, message, details? }; appointments and payments services convertedROADMAP.mdupdated (item status + changelog line)Closes #115