|
|
|
|
@ -4,6 +4,7 @@ import com.zbkj.common.exception.CrmebException; |
|
|
|
|
import com.zbkj.common.model.exception.ExceptionLog; |
|
|
|
|
import com.zbkj.common.result.CommonResult; |
|
|
|
|
import com.zbkj.service.service.ExceptionLogService; |
|
|
|
|
import com.zbkj.service.service.RetryService; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.dao.DataIntegrityViolationException; |
|
|
|
|
@ -41,7 +42,8 @@ import java.util.Objects; |
|
|
|
|
@Slf4j |
|
|
|
|
@RestControllerAdvice |
|
|
|
|
public class GlobalExceptionHandler { |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private RetryService retryService; |
|
|
|
|
// private static String REQUESTBODY = "requestBodyMessage";
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
@ -122,6 +124,7 @@ public class GlobalExceptionHandler { |
|
|
|
|
if (e instanceof MissingServletRequestParameterException) { |
|
|
|
|
return CommonResult.failed().setMessage(Objects.requireNonNull(e.getMessage())); |
|
|
|
|
} |
|
|
|
|
retryService.systemErrNc(e.getMessage()); |
|
|
|
|
//未知错误
|
|
|
|
|
return CommonResult.failed().setMessage(e.getMessage()); |
|
|
|
|
} |
|
|
|
|
|