mirror of
https://github.com/monero-project/monero.git
synced 2024-12-28 23:06:16 -05:00
use const references in catch blocks
This commit is contained in:
parent
c642d3224c
commit
d023831327
@ -168,7 +168,7 @@ namespace command_line
|
||||
{
|
||||
return parser();
|
||||
}
|
||||
catch (std::exception& e)
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr << "Failed to parse arguments: " << e.what() << std::endl;
|
||||
std::cerr << desc << std::endl;
|
||||
|
@ -1327,7 +1327,7 @@ std::string simple_wallet::get_mnemonic_language()
|
||||
fail_msg_writer() << tr("invalid language choice passed. Please try again.\n");
|
||||
}
|
||||
}
|
||||
catch (std::exception &e)
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
fail_msg_writer() << tr("invalid language choice passed. Please try again.\n");
|
||||
}
|
||||
@ -4053,7 +4053,7 @@ bool simple_wallet::export_key_images(const std::vector<std::string> &args)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (std::exception &e)
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
LOG_ERROR("Error exporting key images: " << e.what());
|
||||
fail_msg_writer() << "Error exporting key images: " << e.what();
|
||||
|
@ -124,7 +124,7 @@ bool PendingTransactionImpl::commit(const std::string &filename, bool overwrite)
|
||||
m_errorString = writer.str();
|
||||
if (!reason.empty())
|
||||
m_errorString += string(tr(". Reason: ")) + reason;
|
||||
} catch (std::exception &e) {
|
||||
} catch (const std::exception &e) {
|
||||
m_errorString = string(tr("Unknown exception: ")) + e.what();
|
||||
m_status = Status_Error;
|
||||
} catch (...) {
|
||||
|
@ -833,7 +833,7 @@ bool WalletImpl::exportKeyImages(const string &filename)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (std::exception &e)
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
LOG_ERROR("Error exporting key images: " << e.what());
|
||||
m_errorString = e.what();
|
||||
|
@ -252,7 +252,7 @@ namespace tools
|
||||
res.balance = m_wallet.balance();
|
||||
res.unlocked_balance = m_wallet.unlocked_balance();
|
||||
}
|
||||
catch (std::exception& e)
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
er.code = WALLET_RPC_ERROR_CODE_UNKNOWN_ERROR;
|
||||
er.message = e.what();
|
||||
@ -267,7 +267,7 @@ namespace tools
|
||||
{
|
||||
res.address = m_wallet.get_account().get_public_address_str(m_wallet.testnet());
|
||||
}
|
||||
catch (std::exception& e)
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
er.code = WALLET_RPC_ERROR_CODE_UNKNOWN_ERROR;
|
||||
er.message = e.what();
|
||||
@ -282,7 +282,7 @@ namespace tools
|
||||
{
|
||||
res.height = m_wallet.get_blockchain_current_height();
|
||||
}
|
||||
catch (std::exception& e)
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
er.code = WALLET_RPC_ERROR_CODE_UNKNOWN_ERROR;
|
||||
er.message = e.what();
|
||||
@ -636,7 +636,7 @@ namespace tools
|
||||
res.payment_id = epee::string_tools::pod_to_hex(payment_id);
|
||||
return true;
|
||||
}
|
||||
catch (std::exception &e)
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
er.code = WALLET_RPC_ERROR_CODE_UNKNOWN_ERROR;
|
||||
er.message = e.what();
|
||||
@ -669,7 +669,7 @@ namespace tools
|
||||
res.payment_id = epee::string_tools::pod_to_hex(payment_id);
|
||||
return true;
|
||||
}
|
||||
catch (std::exception &e)
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
er.code = WALLET_RPC_ERROR_CODE_UNKNOWN_ERROR;
|
||||
er.message = e.what();
|
||||
@ -691,7 +691,7 @@ namespace tools
|
||||
{
|
||||
m_wallet.store();
|
||||
}
|
||||
catch (std::exception& e)
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
er.code = WALLET_RPC_ERROR_CODE_UNKNOWN_ERROR;
|
||||
er.message = e.what();
|
||||
@ -911,7 +911,7 @@ namespace tools
|
||||
{
|
||||
m_wallet.rescan_blockchain();
|
||||
}
|
||||
catch (std::exception& e)
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
er.code = WALLET_RPC_ERROR_CODE_UNKNOWN_ERROR;
|
||||
er.message = e.what();
|
||||
@ -970,7 +970,7 @@ namespace tools
|
||||
m_wallet.store();
|
||||
m_stop.store(true, std::memory_order_relaxed);
|
||||
}
|
||||
catch (std::exception& e)
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
er.code = WALLET_RPC_ERROR_CODE_UNKNOWN_ERROR;
|
||||
er.message = e.what();
|
||||
|
Loading…
Reference in New Issue
Block a user