diff options
author | Riccardo Spagni <ric@spagni.net> | 2015-10-30 09:58:58 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2015-10-30 09:59:00 +0200 |
commit | 9ea58ebbaeca6a8eaae1fa2835f3e2b95203c241 (patch) | |
tree | 13021112f0b9bb79502ac905192d2237a3113c11 /src | |
parent | Merge pull request #460 (diff) | |
parent | blockchain_utilities: properly exit on error (diff) | |
download | monero-9ea58ebbaeca6a8eaae1fa2835f3e2b95203c241.tar.xz |
Merge pull request #461
bc110af blockchain_utilities: properly exit on error (moneromooo-monero)
Diffstat (limited to '')
-rw-r--r-- | src/blockchain_utilities/blockchain_dump.cpp | 12 | ||||
-rw-r--r-- | src/blockchain_utilities/blockchain_export.cpp | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/blockchain_utilities/blockchain_dump.cpp b/src/blockchain_utilities/blockchain_dump.cpp index ce028f663..da5a2ec39 100644 --- a/src/blockchain_utilities/blockchain_dump.cpp +++ b/src/blockchain_utilities/blockchain_dump.cpp @@ -185,7 +185,7 @@ int main(int argc, char* argv[]) if (!boost::filesystem::is_directory(dir_path)) { LOG_PRINT_RED_L0("dump directory path is a file: " << dir_path); - return false; + return 1; } } else @@ -193,7 +193,7 @@ int main(int argc, char* argv[]) if (!boost::filesystem::create_directory(dir_path)) { LOG_PRINT_RED_L0("Failed to create directory " << dir_path); - return false; + return 1; } } } @@ -201,7 +201,7 @@ int main(int argc, char* argv[]) std::ofstream raw_data_file; raw_data_file.open(output_file_path.string(), std::ios_base::out | std::ios::trunc); if (raw_data_file.fail()) - return false; + return 1; // If we wanted to use the memory pool, we would set up a fake_core. @@ -245,7 +245,7 @@ int main(int argc, char* argv[]) else { LOG_PRINT_L0("Invalid db type: " << db_type); - throw; + return 1; } boost::filesystem::path folder(m_config_folder); folder /= db->get_db_name(); @@ -259,7 +259,7 @@ int main(int argc, char* argv[]) catch (const std::exception& e) { LOG_PRINT_L0("Error opening database: " << e.what()); - throw; + return 1; } r = core_storage->init(db, opt_testnet); #endif @@ -425,7 +425,7 @@ int main(int argc, char* argv[]) CHECK_AND_ASSERT_MES(r, false, "Failed to dump blockchain"); if (raw_data_file.fail()) - return false; + return 1; raw_data_file.flush(); LOG_PRINT_L0("Blockchain dump OK"); diff --git a/src/blockchain_utilities/blockchain_export.cpp b/src/blockchain_utilities/blockchain_export.cpp index 4a96bad6b..1bdaa3d7e 100644 --- a/src/blockchain_utilities/blockchain_export.cpp +++ b/src/blockchain_utilities/blockchain_export.cpp @@ -151,7 +151,7 @@ int main(int argc, char* argv[]) catch (const std::exception& e) { LOG_PRINT_L0("Error opening database: " << e.what()); - throw; + return 1; } r = core_storage->init(db, opt_testnet); #endif |