Exception Handling
Graceful response handling
GlobalExceptionHandler
: Centralized handling of exceptions, capturing and processing them uniformly.ApiResponse
: Standardizes the response data format for APIs. A normal API response includes amessage
or an Object data, with acode
of 200.- Custom Exceptions (Inheriting from
BaseException
): Custom exceptions created by inheriting fromBaseException
. These exceptions are associated with specificstatusCode
values and loglevel
. Then, custom exceptions can be thrown usingthrow new xxxException
.
Exception Capture and Monitoring
Sentry Integration
Modify the configuration file sentry.properties