Skip to content

feat(#47): standardise API error response envelopes#68

Open
Dwifax wants to merge 1 commit into
Adamantine-guild:mainfrom
Dwifax:fix/47-error-response-envelopes
Open

feat(#47): standardise API error response envelopes#68
Dwifax wants to merge 1 commit into
Adamantine-guild:mainfrom
Dwifax:fix/47-error-response-envelopes

Conversation

@Dwifax

@Dwifax Dwifax commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Standardises API error response envelopes across all endpoints per issue #47.

Changes

  • Add consistent error response format with success, error, data fields
  • Update all existing routes to use the new error envelope
  • Add error handler middleware for unhandled exceptions

Related Issue

Closes #47

- Add structured ApiError envelope (error, code, message, statusCode, details)
- Add errors.ts module with typed error classes (NotFoundError, ValidationError, ForbiddenError, etc.)
- Update all routes to return standardised error envelopes
- Update apiContract with error envelope shapes & response types
- Update sdk-lite errors.ts with code/details fields for envelope parsing
- Update sdk-lite index.ts with parseErrorEnvelope() for structured error extraction
- Add integration tests (routes.integration.test.ts) covering all endpoints
- Add sdk-lite tests for envelope parsing, truncation, network errors

Closes Adamantine-guild#47
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.

Standardise API error response envelopes

1 participant