Skip to content

fix: add API error handler helper + JSON body size limit (closes #7, closes #9) - #9192

Open
hermesxclaw-ctrl wants to merge 1 commit into
xevrion-v2:mainfrom
hermesxclaw-ctrl:fix/api-error-handler-body-limit
Open

fix: add API error handler helper + JSON body size limit (closes #7, closes #9)#9192
hermesxclaw-ctrl wants to merge 1 commit into
xevrion-v2:mainfrom
hermesxclaw-ctrl:fix/api-error-handler-body-limit

Conversation

@hermesxclaw-ctrl

Copy link
Copy Markdown

Changes

#7 — API Error Handling Helper

  • Added apiError() helper for consistent JSON error responses
  • Applied try/catch + apiError to both GET and POST /users routes
  • Returns proper error shape: { error: true, message: string }

#9 — JSON Body Size Limit

  • Added express.json({ limit: MAX_BODY_SIZE }) — defaults to 1mb
  • Configurable via MAX_BODY_SIZE env var
  • Prevents resource exhaustion from oversized payloads

Files Changed

  • apps/api/src/index.ts — body size limit
  • apps/api/src/routes/users.ts — error handler helper + try/catch

- Add apiError() helper for consistent error responses (xevrion-v2#7)
- Apply error handling to GET/POST /users routes
- Add express.json body size limit (default 1mb) (xevrion-v2#9)
- Configurable via MAX_BODY_SIZE env var
github-actions Bot added a commit that referenced this pull request Aug 5, 2026
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.

2 participants