@ResponseBody @ControllerAdvice(annotations={org.springframework.web.bind.annotation.RestController.class,org.springframework.stereotype.Controller.class}) public class GlobalExceptionHandler extends Object
Constructor and Description |
---|
GlobalExceptionHandler() |
Modifier and Type | Method and Description |
---|---|
Result<String> |
doExceptionForDatabase(SQLIntegrityConstraintViolationException ex)
数据库异常处理方法
|
@ExceptionHandler(value=java.sql.SQLIntegrityConstraintViolationException.class) public Result<String> doExceptionForDatabase(SQLIntegrityConstraintViolationException ex)
Copyright © 2022. All rights reserved.