|
@@ -1,5 +1,6 @@
|
|
|
package com.fdkankan.manage.exception;
|
|
|
|
|
|
+import com.fdkankan.manage.common.ResultCode;
|
|
|
import com.fdkankan.manage.common.ResultData;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
|
@@ -20,6 +21,9 @@ public class GlobalExceptionHandler {
|
|
|
@ExceptionHandler(value = Exception.class)
|
|
|
public ResultData exceptionHandler(Exception e) throws Exception {
|
|
|
log.error("服务错误:", e);
|
|
|
+ if(e.getMessage().contains("too long")){
|
|
|
+ throw new BusinessException(ResultCode.DATA_TOO_LONG);
|
|
|
+ }
|
|
|
return ResultData.error( 500, e.getCause().getMessage());
|
|
|
}
|
|
|
|