Skip to content

#886 [GOOD FIRST ISSUE] Standardize Global Error Response Payload Structure#1149

Closed
Meek-Maestro wants to merge 0 commit into
sublime247:mainfrom
Meek-Maestro:main
Closed

#886 [GOOD FIRST ISSUE] Standardize Global Error Response Payload Structure#1149
Meek-Maestro wants to merge 0 commit into
sublime247:mainfrom
Meek-Maestro:main

Conversation

@Meek-Maestro
Copy link
Copy Markdown
Contributor

#886 [GOOD FIRST ISSUE] Standardize Global Error Response Payload Structure

Description

Replaced all manual res.status().json() error responses throughout the codebase with centralized throw createError() calls using standardized ERROR_CODES. This ensures consistent error response formatting and enables the global error handler middleware to manage all error responses uniformly.

Related Issue

Fixes #886

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Code refactoring
  • Performance improvement

Changes Made

  • Replaced all res.status().json() error responses with throw createError(ERROR_CODES.XXX, ...)
  • Updated KYC controllers (workflow runs, SDK tokens, verification status, webhooks)
  • Refactored document upload and retrieval endpoints
  • Updated fee strategy CRUD and admin routes
  • Refactored reconciliation service endpoints (uploads, reports, discrepancies, alerts)
  • Updated exchange rate buffer CRUD operations
  • Refactored asset management endpoints (issuance, listing)
  • Updated user settings and GDPR/privacy endpoints
  • Refactored admin middleware (requireAdmin, requireSuperAdmin)
  • Updated admin metrics and bulk operations (freeze, unfreeze, unlock users, transactions)
  • Refactored impersonation token generation
  • Updated liquidity transfers and CSV reconciliation
  • Refactored compliance document CRUD operations
  • Updated Stellar operations (clawback, batch payments)
  • Refactored KYC upgrade request endpoints (approve, reject, bulk)
  • Updated SEP protocols (SEP-10, SEP-12, SEP-24, SEP-31)
  • Refactored queue health and management endpoints

Checklist

  • Code follows project style
  • Self-reviewed my code
  • Commented complex code
  • Updated documentation (if needed)
  • No new warnings

Screenshots (if applicable)

N/A

Additional Notes

Health check endpoints (e.g., /ready, /health) that intentionally return dynamic status codes (200/503) were kept as-is since they represent expected states rather than error conditions.

@sublime247
Copy link
Copy Markdown
Owner

@Meek-Maestro please resolve conflicts

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.

[GOOD FIRST ISSUE] Standardize Global Error Response Payload Structure

2 participants