|
|
@@ -22,12 +22,18 @@ import java.util.Set;
|
|
|
@Configuration
|
|
|
public class GlobalSystemExceptionHandler {
|
|
|
|
|
|
- @ExceptionHandler(value = {SystemException.class, RuntimeException.class})
|
|
|
+ @ExceptionHandler(value = SystemException.class)
|
|
|
@ResponseBody
|
|
|
public HttpResult handlerSystemException(SystemException e) {
|
|
|
return HttpResult.error(e.getCode(), e.getMessage());
|
|
|
}
|
|
|
|
|
|
+ @ExceptionHandler(value = RuntimeException.class)
|
|
|
+ @ResponseBody
|
|
|
+ public HttpResult handlerRuntimeException(RuntimeException e) {
|
|
|
+ return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, e.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* BusinessException处理
|
|
|
*
|