|
@@ -2,6 +2,8 @@ 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.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import reactor.core.publisher.Mono;
|
|
|
|
|
|
/**
|
|
@@ -21,6 +23,7 @@ public class CustomExceptionHandler {
|
|
|
}
|
|
|
|
|
|
@ExceptionHandler(IllegalAccessException.class)
|
|
|
+ @ResponseBody
|
|
|
public Mono<String> convertIllegalAccessError(Exception e) {
|
|
|
//自定义逻辑,可返回其他值
|
|
|
return Mono.just("illegal access");
|