This commit is contained in:
阿沐 2024-12-19 19:04:56 +08:00
parent 19d743e214
commit 299f2d4f85

View File

@ -51,6 +51,12 @@ public class ServerExceptionHandler {
return Result.error(ErrorCode.FORBIDDEN);
}
@ExceptionHandler(IllegalArgumentException.class)
public Result<String> handleIllegalArgumentException(Exception ex) {
return Result.error(ex.getMessage());
}
@ExceptionHandler(Exception.class)
public Result<String> handleException(Exception ex) {
log.error(ex.getMessage(), ex);