|
|
@@ -20,7 +20,7 @@ public class ExceptionHandlerAdvice {
|
|
|
|
|
|
/**
|
|
|
* 处理运行时抛出异常
|
|
|
- *
|
|
|
+ *
|
|
|
* @param ex 运行时异常
|
|
|
* @return 键值对
|
|
|
*/
|
|
|
@@ -34,11 +34,11 @@ public class ExceptionHandlerAdvice {
|
|
|
|
|
|
/**
|
|
|
* 允许用户看见的异常信息,直接传递给客户端
|
|
|
- *
|
|
|
+ *
|
|
|
* @param ex 允许用户看见的异常信息
|
|
|
* @return
|
|
|
*/
|
|
|
- @ExceptionHandler(VisibleError.class)
|
|
|
+ @ExceptionHandler({VisibleError.class, IllegalArgumentException.class})
|
|
|
public ResponseEntity<ModelMap> handleVisibleError(VisibleError ex) {
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
|
headers.add("Content-Type", "application/json; charset=utf-8");
|