This commit is contained in:
2025-12-29 23:26:06 +08:00
parent 76d498b9a3
commit e323aa38ac
10 changed files with 150 additions and 35 deletions

View File

@@ -23,6 +23,7 @@ import org.springframework.jdbc.UncategorizedSQLException;
import org.springframework.validation.BindException;
import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.MissingServletRequestParameterException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
@@ -50,7 +51,8 @@ public class EmoneyAutoPlatformExceptionHandler {
@ExceptionHandler({
BindException.class,
ConstraintViolationException.class,
MethodArgumentNotValidException.class })
MethodArgumentNotValidException.class,
MissingServletRequestParameterException.class})
@ResponseBody
@ResponseStatus(HttpStatus.BAD_REQUEST)
public <Ex extends BindException> R<?> handleBindException(Ex ex) {