Skip to content

docs(#685): create API error codes reference#957

Open
jerrymusaga wants to merge 1 commit into
bakeronchain:mainfrom
jerrymusaga:docs/685-api-error-codes-reference
Open

docs(#685): create API error codes reference#957
jerrymusaga wants to merge 1 commit into
bakeronchain:mainfrom
jerrymusaga:docs/685-api-error-codes-reference

Conversation

@jerrymusaga
Copy link
Copy Markdown
Contributor

Summary

Closes #685.

  • Adds docs/api/error-codes.md — the first centralised reference for all HTTP status codes and error responses in the LearnVault API
  • Documents the error response JSON schema (including the details array shape for validation errors and the stack field in non-production)
  • Covers all 11 HTTP status codes used (200503) with a table explaining when each is returned
  • Lists every application-level error message grouped by category: auth/authz (401/403), validation (400), resource (404), conflict (409/410), rate limits (429), external services (502/503), and server errors (500)
  • Includes concrete HTTP request/response examples for each error category
  • Provides a client-side handling guide with TypeScript snippets for dispatching on status codes, rendering field-level validation errors, and retrying rate-limited requests with Retry-After
  • Cross-links to docs/openapi.yaml and docs/request-tracing.md

Test plan

  • Read through docs/api/error-codes.md and verify it renders correctly on GitHub
  • Spot-check a few error messages against the source files (server/src/middleware/error.middleware.ts, server/src/middleware/rate-limit.middleware.ts, representative controllers)
  • Confirm the TypeScript examples in the client-side guide compile without errors

Adds docs/api/error-codes.md covering all HTTP status codes, error
response JSON schema, application-level error messages (auth, validation,
conflict, rate-limit, external service, server), per-error examples,
and a client-side handling guide with TypeScript snippets.
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 30, 2026

@jerrymusaga 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! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: create API error codes reference

1 participant