From 1987bc97a98b5a69b4b5cebde0eb51c4a94217ab Mon Sep 17 00:00:00 2001 From: zhaojun1998 Date: Sat, 27 Jun 2020 21:13:24 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=94=B9=E8=BF=9B=20README=20=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=B8=8D=E5=AD=98=E5=9C=A8=E6=97=B6,=20=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E5=A4=84=E7=90=86=E6=9C=BA=E5=88=B6.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../im/zhaojun/zfile/controller/home/FileController.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/im/zhaojun/zfile/controller/home/FileController.java b/src/main/java/im/zhaojun/zfile/controller/home/FileController.java index 740b536..fc34a19 100644 --- a/src/main/java/im/zhaojun/zfile/controller/home/FileController.java +++ b/src/main/java/im/zhaojun/zfile/controller/home/FileController.java @@ -2,6 +2,7 @@ package im.zhaojun.zfile.controller.home; import com.alibaba.fastjson.JSON; import im.zhaojun.zfile.context.DriveContext; +import im.zhaojun.zfile.exception.NotExistFileException; import im.zhaojun.zfile.model.constant.ZFileConstant; import im.zhaojun.zfile.model.dto.FileItemDTO; import im.zhaojun.zfile.model.dto.SystemFrontConfigDTO; @@ -139,7 +140,11 @@ public class FileController { String readme = HttpUtil.getTextContent(fileItem.getUrl()); systemConfig.setReadme(readme); } catch (Exception e) { - log.error("获取 README 文件异常, fullPath: {}, fileItem: {}", fullPath, JSON.toJSONString(fileItem), e); + if (e instanceof NotExistFileException) { + log.debug("不存在 README 文件, 已跳过, fullPath: {}, fileItem: {}", fullPath, JSON.toJSONString(fileItem)); + } else { + log.error("获取 README 文件异常, fullPath: {}, fileItem: {}", fullPath, JSON.toJSONString(fileItem), e); + } } return ResultBean.successData(systemConfig);