From 2f17e71eec48fa141b0f2b0a2b418de3260b32d3 Mon Sep 17 00:00:00 2001 From: iture123 <1011699225@qq.com> Date: Sun, 6 Oct 2019 07:50:11 +0800 Subject: [PATCH] throw excetion instead of swallow it (#919) --- .../src/main/java/cn/escheduler/common/utils/HadoopUtils.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/escheduler-common/src/main/java/cn/escheduler/common/utils/HadoopUtils.java b/escheduler-common/src/main/java/cn/escheduler/common/utils/HadoopUtils.java index 6bc33eca42..bcea353a60 100644 --- a/escheduler-common/src/main/java/cn/escheduler/common/utils/HadoopUtils.java +++ b/escheduler-common/src/main/java/cn/escheduler/common/utils/HadoopUtils.java @@ -288,9 +288,11 @@ public class HadoopUtils implements Closeable { if (dstPath.isFile()) { if (overwrite) { dstPath.delete(); + }else{ + throw new IOException("destination file already exists!"); } } else { - logger.error("destination file must be a file"); + throw new IOException("destination file must be a file!"); } }