bổ sung thêm chức năng

This commit is contained in:
2026-01-27 21:55:14 +07:00
parent 8086bcfe0c
commit 962cd5d873
48 changed files with 958 additions and 187 deletions

View File

@@ -27,4 +27,22 @@ public class GlobalExceptionHandler {
public Map<String, String> handleNotFound(UserNotFoundException ex) {
return Map.of("message", ex.getMessage());
}
@ExceptionHandler(GiftCodeReservationException.class)
@ResponseStatus(HttpStatus.BAD_REQUEST)
public Map<String, String> handleGiftCodeReservation(GiftCodeReservationException ex) {
return Map.of("message", ex.getMessage());
}
@ExceptionHandler(LocalProcessingException.class)
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
public Map<String, String> handleLocalProcessing(LocalProcessingException ex) {
return Map.of("message", ex.getMessage());
}
@ExceptionHandler(RuntimeException.class)
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
public Map<String, String> handleRuntimeException(RuntimeException ex) {
return Map.of("message", "An unexpected error occurred: " + ex.getMessage());
}
}