From 82cdc9bfa380256e0c0821abffb49064ba51445e Mon Sep 17 00:00:00 2001 From: Zhangmei Li Date: Mon, 27 Dec 2021 14:41:52 +0800 Subject: [PATCH] fix ConfigUtil error message Change-Id: Id6d9d6207a67ce2587d8d923c7ce9455c14eed9f --- .../src/main/java/com/baidu/hugegraph/util/ConfigUtil.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/util/ConfigUtil.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/util/ConfigUtil.java index 0b80561ac3..c1fb3fb3ad 100644 --- a/hugegraph-core/src/main/java/com/baidu/hugegraph/util/ConfigUtil.java +++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/util/ConfigUtil.java @@ -54,7 +54,8 @@ public static void checkGremlinConfig(String conf) { try { yamlConfig.load(conf); } catch (ConfigurationException e) { - throw new HugeException("Failed to load yaml config file ", conf); + throw new HugeException("Failed to load yaml config file '%s'", + conf); } List nodes = yamlConfig.getRootNode() .getChildren(NODE_GRAPHS); @@ -100,7 +101,7 @@ public static void writeToFile(String dir, String graphName, config.setFileName(fileName); LOG.info("Write HugeConfig to file: '{}'", fileName); } catch (IOException | ConfigurationException e) { - throw new HugeException("Failed to write HugeConfig to file '{}'", + throw new HugeException("Failed to write HugeConfig to file '%s'", e, fileName); } } @@ -112,7 +113,7 @@ public static void deleteFile(File file) { try { FileUtils.forceDelete(file); } catch (IOException e) { - throw new HugeException("Failed to delete HugeConfig file '{}'", + throw new HugeException("Failed to delete HugeConfig file '%s'", e, file); } }