package com.zxyj.config; import com.zxyj.common.Result; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.RestControllerAdvice; @RestControllerAdvice public class GlobalExceptionHandler { @ExceptionHandler(IllegalArgumentException.class) public Result handleIllegalArgumentException(IllegalArgumentException e) { return Result.error(400, e.getMessage()); } }