Skip to content

Commit

Permalink
Provide error code with directory create failure.
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed Jan 3, 2025
1 parent d91e3c0 commit 3fe83b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions console/executor_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
4 changes: 2 additions & 2 deletions console/localize.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit 3fe83b9

Please sign in to comment.