diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-12-11 23:04:57 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-12-18 15:15:43 +0000 |
commit | a4240d9ffcef137a273f6042332a62cca43e0983 (patch) | |
tree | 95fd472a6e74e0124683dc0f9905d5b02bcd8f05 /src | |
parent | add empty container sanity checks when using front() and back() (diff) | |
download | monero-a4240d9ffcef137a273f6042332a62cca43e0983.tar.xz |
catch const exceptions
Diffstat (limited to '')
-rw-r--r-- | src/blockchain_db/lmdb/db_lmdb.cpp | 2 | ||||
-rw-r--r-- | src/daemon/command_parser_executor.cpp | 6 | ||||
-rw-r--r-- | src/simplewallet/simplewallet.cpp | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp index 07a0e67b1..ee4368e86 100644 --- a/src/blockchain_db/lmdb/db_lmdb.cpp +++ b/src/blockchain_db/lmdb/db_lmdb.cpp @@ -2894,7 +2894,7 @@ uint64_t BlockchainLMDB::add_block(const block& blk, const size_t& block_size, c { BlockchainDB::add_block(blk, block_size, cumulative_difficulty, coins_generated, txs); } - catch (DB_ERROR_TXN_START& e) + catch (const DB_ERROR_TXN_START& e) { throw; } diff --git a/src/daemon/command_parser_executor.cpp b/src/daemon/command_parser_executor.cpp index 5307b2472..8970f9407 100644 --- a/src/daemon/command_parser_executor.cpp +++ b/src/daemon/command_parser_executor.cpp @@ -173,7 +173,7 @@ bool t_command_parser_executor::print_block(const std::vector<std::string>& args uint64_t height = boost::lexical_cast<uint64_t>(arg); return m_executor.print_block_by_height(height); } - catch (boost::bad_lexical_cast&) + catch (const boost::bad_lexical_cast&) { crypto::hash block_hash; if (parse_hash256(arg, block_hash)) @@ -420,7 +420,7 @@ bool t_command_parser_executor::out_peers(const std::vector<std::string>& args) limit = std::stoi(args[0]); } - catch(std::exception& ex) { + catch(const std::exception& ex) { _erro("stoi exception"); return false; } @@ -450,7 +450,7 @@ bool t_command_parser_executor::hard_fork_info(const std::vector<std::string>& a try { version = std::stoi(args[0]); } - catch(std::exception& ex) { + catch(const std::exception& ex) { return false; } if (version <= 0 || version > 255) diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index e34e718d2..0a5c9e531 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -5175,7 +5175,7 @@ bool simple_wallet::show_transfers(const std::vector<std::string> &args_) try { min_height = boost::lexical_cast<uint64_t>(local_args[0]); } - catch (boost::bad_lexical_cast &) { + catch (const boost::bad_lexical_cast &) { fail_msg_writer() << tr("bad min_height parameter:") << " " << local_args[0]; return true; } @@ -5187,7 +5187,7 @@ bool simple_wallet::show_transfers(const std::vector<std::string> &args_) try { max_height = boost::lexical_cast<uint64_t>(local_args[0]); } - catch (boost::bad_lexical_cast &) { + catch (const boost::bad_lexical_cast &) { fail_msg_writer() << tr("bad max_height parameter:") << " " << local_args[0]; return true; } |