Skip to content

centralize API error handling across all backend services - #591

Merged
Abd-Standard merged 1 commit into
Core-Foundry:mainfrom
Jessepriase:centralize-api-error-handling
Aug 2, 2026
Merged

centralize API error handling across all backend services#591
Abd-Standard merged 1 commit into
Core-Foundry:mainfrom
Jessepriase:centralize-api-error-handling

Conversation

@Jessepriase

Copy link
Copy Markdown
Contributor
  • Add centralized error handler (error-handler.ts) with ApiError class and handleApiError utility
  • Replace all raw res.writeHead/res.end error responses with sendErr/handleApiError
  • Replace all raw res.writeHead success responses with sendOk
  • Fix duplicate/broken route handlers in events-server.ts
  • Update rate-limiter.ts to use sendErr for 429 responses
  • Ensure all endpoints return consistent error response format

Overview

Related Issue

Closes #

Changes

Verification

# e.g.
cd dashboard && npm test
cd listener && npm run typecheck && npm test
cd contract/contracts/hello-world && cargo test

How to Test

Checklist

  • Branch is up to date with main
  • Tests added/updated and all pass locally
  • cargo fmt --all run (if Rust changes)
  • npm run lint passes (if TypeScript changes)
  • Documentation updated if behavior changed
    closes Centralize API Error Handling #381

- Add centralized error handler (error-handler.ts) with ApiError class and handleApiError utility
- Replace all raw res.writeHead/res.end error responses with sendErr/handleApiError
- Replace all raw res.writeHead success responses with sendOk
- Fix duplicate/broken route handlers in events-server.ts
- Update rate-limiter.ts to use sendErr for 429 responses
- Ensure all endpoints return consistent error response format
@Abd-Standard
Abd-Standard merged commit a3a74b2 into Core-Foundry:main Aug 2, 2026
0 of 6 checks passed
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.

Centralize API Error Handling

2 participants