Skip to content

Conversation

@munishchouhan
Copy link
Member

Summary

Improves error handling by introducing a sanitized ErrorResponse model that prevents exposure of internal implementation details in API error responses.

Changes

  • New ErrorResponse class: Standardized error response model with timestamp, status, error type, message, request ID, and path
  • Enhanced ErrorController: Added specific error handlers for common exceptions (JSON parsing, validation, conversion errors) with sanitized user-friendly messages and
    request ID tracking for debugging
  • Comprehensive test coverage: Added ErrorHandlingTest to verify error sanitization and proper HTTP status codes

Benefits

  • Prevents leakage of sensitive internal implementation details in error responses
  • Provides consistent error response format across all endpoints
  • Includes request IDs for easier debugging while keeping responses user-friendly
  • Improves security posture by sanitizing error messages

Signed-off-by: munishchouhan <[email protected]>
@munishchouhan munishchouhan changed the title Added ErrorResponse COMP-1146 Fix error messages Jan 5, 2026
@munishchouhan munishchouhan self-assigned this Jan 5, 2026
@munishchouhan munishchouhan marked this pull request as draft January 5, 2026 16:13
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