Add machine‑readable error catalogue endpoint and integration#1592
Open
d3v-active wants to merge 3 commits into
Open
Add machine‑readable error catalogue endpoint and integration#1592d3v-active wants to merge 3 commits into
d3v-active wants to merge 3 commits into
Conversation
Collaborator
|
@d3v-active tell your agent to run bun command with prettier to format the code Then check ✅ it again with bun after with bun prettier check ✅... That the case for all your issues. If you have CODEX try using it or just connect your GitHub with GPT and use chatGPT work with the GitHub mcp It should also solve it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1534
Summary
This PR introduces a stable, versioned JSON endpoint that publishes a catalogue of all public API error codes. The catalogue is generated directly from the server’s error registry, ensuring that documentation and client code stay in sync and eliminating manual drift.
Changes Made
src/server/api/errors.tserrorCatalogueconstant containing each public error’scode, HTTPstatus,retryableflag, and a concisesummary.• Implemented
getErrorCatalogueExpress handler that returns a versioned JSON payload (version,generatedAt,errors).src/server/routes/errorCatalogue.ts/errorsendpoint to an Express router usinggetErrorCatalogue.src/server/router.tsattachErrorCatalogueRoute.• Added call to
attachErrorCatalogueRoute(router)so the endpoint is exposed alongside existing routes.src/server/api/openapi.ts/errorspath with a summary, making the endpoint discoverable via the API documentation.Acceptance Criteria Met
errorCataloguearray is defined alongside the existingApiErrorCodeenum, guaranteeing it reflects the current error set.internal_error) is deliberately omitted from the catalogue.status,retryable, and a meaningfulsummary./errorsendpoint, exposing it to API consumers.Why This Matters
Testing
npm test) – all tests pass.npm run dev) andGET /api/v1/errorsreturns a JSON payload with the version, timestamp, and error list./openapi.json) now includes the/errorspath.