Skip to content

🔴 CRITICAL: Add global exception handler #3

@GitAddRemote

Description

@GitAddRemote

Problem

No consistent error handling:

  • No @ControllerAdvice
  • JwtAuthFilter silently swallows exceptions
  • Inconsistent error responses

Solution

Create GlobalExceptionHandler with @RestControllerAdvice:

  • Handle MethodArgumentNotValidException
  • Handle AccessDeniedException
  • Handle custom business exceptions
  • Return structured ApiError responses

Files to Create

  • libs/common/.../ApiError.java
  • apps/backend/.../GlobalExceptionHandler.java
  • Custom exception classes

Files to Modify

  • JwtAuthFilter.java (fix exception handling)
  • AuthController.java (structured responses)

Acceptance Criteria

  • GlobalExceptionHandler with @RestControllerAdvice
  • Structured error response format
  • Consistent HTTP status codes
  • Tests for error scenarios

Priority

🔴 Critical - Required for production operations

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiAPI relatedcriticalCritical priority - must fix before productionerror-handlingError handling and exceptions

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions