Skip to content

Commit 3fe83b9

Browse files
committed
Provide error code with directory create failure.
1 parent d91e3c0 commit 3fe83b9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

console/executor_store.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ bool executor::check_store_path(bool create) const
5959
if (create)
6060
{
6161
logger(format(BN_INITIALIZING_CHAIN) % store);
62-
if (!database::file::create_directory(store))
62+
if (auto ec = database::file::create_directory_ex(store))
6363
{
64-
logger(format(BN_INITCHAIN_EXISTS) % store);
64+
logger(format(BN_INITCHAIN_DIRECTORY_ERROR) % store % ec.message());
6565
return false;
6666
}
6767
}

console/localize.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ namespace node {
3838
// --initchain
3939
#define BN_INITIALIZING_CHAIN \
4040
"Initializing %1% directory..."
41-
#define BN_INITCHAIN_EXISTS \
42-
"Failed because the directory %1% already exists."
41+
#define BN_INITCHAIN_DIRECTORY_ERROR \
42+
"Failed creating directory %1% with error '%2%'."
4343
#define BN_INITCHAIN_CREATING \
4444
"Please wait while creating the database..."
4545
#define BN_INITCHAIN_CREATED \

0 commit comments

Comments
 (0)