Skip to content

Add Global HTTP Exception Filter #28

@fati-Onchain

Description

@fati-Onchain

Description: Error responses are not consistently formatted across the application. Implement a global exception filter that standardises all error payloads including validation errors, auth errors, and unexpected exceptions.

Tasks:

  • Create a GlobalExceptionFilter that implements ExceptionFilter
  • Standardise error response shape: { statusCode, message, error, timestamp, path }
  • Handle HttpException, QueryFailedError (TypeORM), and unknown errors distinctly
  • Register the filter globally in main.ts
  • Write unit tests covering each error category

Acceptance Criteria:

  • All error responses follow the same JSON structure
  • Database errors do not leak raw SQL messages to clients
  • Unexpected errors return 500 with a safe generic message

ETA: 1 day


Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions