Description
Error handling is inconsistent across the API. Some errors return 500 with stack traces, others return null, and some throw uncaught exceptions.
Requirements
- Add
@ControllerAdvice for global exception handling
- Return proper HTTP status codes (400, 404, 409, 422, 500)
- Consistent error response format (code, message, details)
- Never expose stack traces in production
- Log all errors with correlation IDs
Files Affected
- Need new:
GlobalExceptionHandler.java
- All controllers need review
Description
Error handling is inconsistent across the API. Some errors return 500 with stack traces, others return null, and some throw uncaught exceptions.
Requirements
@ControllerAdvicefor global exception handlingFiles Affected
GlobalExceptionHandler.java