mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-30 03:03:17 +00:00
catch const exceptions
This commit is contained in:
parent
45a1c4c088
commit
a4240d9ffc
4 changed files with 7 additions and 7 deletions
|
@ -161,7 +161,7 @@ DISABLE_GCC_WARNING(maybe-uninitialized)
|
||||||
val = boost::lexical_cast<XType>(str_id);
|
val = boost::lexical_cast<XType>(str_id);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch(std::exception& /*e*/)
|
catch(const std::exception& /*e*/)
|
||||||
{
|
{
|
||||||
//const char* pmsg = e.what();
|
//const char* pmsg = e.what();
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -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);
|
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;
|
throw;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
uint64_t height = boost::lexical_cast<uint64_t>(arg);
|
||||||
return m_executor.print_block_by_height(height);
|
return m_executor.print_block_by_height(height);
|
||||||
}
|
}
|
||||||
catch (boost::bad_lexical_cast&)
|
catch (const boost::bad_lexical_cast&)
|
||||||
{
|
{
|
||||||
crypto::hash block_hash;
|
crypto::hash block_hash;
|
||||||
if (parse_hash256(arg, 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]);
|
limit = std::stoi(args[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
catch(std::exception& ex) {
|
catch(const std::exception& ex) {
|
||||||
_erro("stoi exception");
|
_erro("stoi exception");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -450,7 +450,7 @@ bool t_command_parser_executor::hard_fork_info(const std::vector<std::string>& a
|
||||||
try {
|
try {
|
||||||
version = std::stoi(args[0]);
|
version = std::stoi(args[0]);
|
||||||
}
|
}
|
||||||
catch(std::exception& ex) {
|
catch(const std::exception& ex) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (version <= 0 || version > 255)
|
if (version <= 0 || version > 255)
|
||||||
|
|
|
@ -5175,7 +5175,7 @@ bool simple_wallet::show_transfers(const std::vector<std::string> &args_)
|
||||||
try {
|
try {
|
||||||
min_height = boost::lexical_cast<uint64_t>(local_args[0]);
|
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];
|
fail_msg_writer() << tr("bad min_height parameter:") << " " << local_args[0];
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -5187,7 +5187,7 @@ bool simple_wallet::show_transfers(const std::vector<std::string> &args_)
|
||||||
try {
|
try {
|
||||||
max_height = boost::lexical_cast<uint64_t>(local_args[0]);
|
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];
|
fail_msg_writer() << tr("bad max_height parameter:") << " " << local_args[0];
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue