Skip to content

Commit

Permalink
Converting release_assert to exception if the ledger file cannot be o…
Browse files Browse the repository at this point in the history
…pened.
  • Loading branch information
clemahieu committed Oct 16, 2023
1 parent 3b22533 commit d0297fc
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions nano/store/lmdb/lmdb_env.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,8 @@ void nano::store::lmdb::env::init (bool & error_a, boost::filesystem::path const
auto status4 (mdb_env_open (environment, path_a.string ().c_str (), environment_flags, 00600));
if (status4 != 0)
{
std::cerr << "Could not open lmdb environment: " << status4;
char * error_str (mdb_strerror (status4));
if (error_str)
{
std::cerr << ", " << error_str;
}
std::cerr << std::endl;
std::string message = "Could not open lmdb environment(" + std::to_string (status4) + "): " + mdb_strerror (status4);
throw std::runtime_error (message);
}
release_assert (status4 == 0);
error_a = status4 != 0;
Expand Down

0 comments on commit d0297fc

Please sign in to comment.