Package io.github.og4dev.exception


package io.github.og4dev.exception
Exception handling classes for comprehensive API error management.

This package provides production-ready centralized exception handling using Spring's RestControllerAdvice mechanism, automatically converting exceptions into RFC 9457 ProblemDetail responses with trace IDs for debugging.

Key components include:

  • GlobalExceptionHandler - Handles 10 common exception types including validation errors, malformed JSON, 404 errors, method not allowed, and more
  • ApiException - Abstract base class for creating custom business logic exceptions with automatic handling

All error responses include:

  • Standard RFC 9457 ProblemDetail format
  • Unique trace ID for request correlation
  • RFC 3339 UTC timestamp
  • Detailed, actionable error messages
  • Automatic SLF4J logging with trace IDs
Since:
1.0.0
Version:
1.4.0
Author:
Pasindu OG
  • Class
    Description
    Base abstract exception class for custom API-related business logic exceptions.
    Global exception handler for Spring Boot REST APIs with comprehensive error coverage.