|
@@ -1,7 +1,7 @@
|
|
|
package com.caimei.www.config;
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.ControllerAdvice;
|
|
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
|
|
-import org.springframework.web.bind.annotation.RestControllerAdvice;
|
|
|
import reactor.core.publisher.Mono;
|
|
|
|
|
|
/**
|
|
@@ -10,14 +10,14 @@ import reactor.core.publisher.Mono;
|
|
|
* @author : Charles
|
|
|
* @date : 2020/8/7
|
|
|
*/
|
|
|
-@RestControllerAdvice
|
|
|
+@ControllerAdvice
|
|
|
public class CustomExceptionHandler {
|
|
|
|
|
|
@ExceptionHandler(Exception.class)
|
|
|
public String convertExceptionMsg(Exception e) {
|
|
|
//自定义逻辑,可返回其他值
|
|
|
e.printStackTrace();
|
|
|
- return "404";
|
|
|
+ return "error/404";
|
|
|
}
|
|
|
|
|
|
@ExceptionHandler(IllegalAccessException.class)
|