From 3fe83b9e1236e35f7451342cf82cd709dc04d91f Mon Sep 17 00:00:00 2001 From: evoskuil Date: Fri, 3 Jan 2025 15:47:18 -0500 Subject: [PATCH] Provide error code with directory create failure. --- console/executor_store.cpp | 4 ++-- console/localize.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/console/executor_store.cpp b/console/executor_store.cpp index 066ad5c8..247de4b8 100644 --- a/console/executor_store.cpp +++ b/console/executor_store.cpp @@ -59,9 +59,9 @@ bool executor::check_store_path(bool create) const if (create) { logger(format(BN_INITIALIZING_CHAIN) % store); - if (!database::file::create_directory(store)) + if (auto ec = database::file::create_directory_ex(store)) { - logger(format(BN_INITCHAIN_EXISTS) % store); + logger(format(BN_INITCHAIN_DIRECTORY_ERROR) % store % ec.message()); return false; } } diff --git a/console/localize.hpp b/console/localize.hpp index 290fca03..e174c825 100644 --- a/console/localize.hpp +++ b/console/localize.hpp @@ -38,8 +38,8 @@ namespace node { // --initchain #define BN_INITIALIZING_CHAIN \ "Initializing %1% directory..." -#define BN_INITCHAIN_EXISTS \ - "Failed because the directory %1% already exists." +#define BN_INITCHAIN_DIRECTORY_ERROR \ + "Failed creating directory %1% with error '%2%'." #define BN_INITCHAIN_CREATING \ "Please wait while creating the database..." #define BN_INITCHAIN_CREATED \