mirror of
https://github.com/monero-project/monero.git
synced 2024-12-23 12:09:54 +00:00
simplewallet: print errors on exceptions creating wallets
Exceptions would otherwise terminate the process silently
This commit is contained in:
parent
51766d026b
commit
c820e1839f
1 changed files with 12 additions and 4 deletions
|
@ -4237,7 +4237,9 @@ boost::optional<tools::password_container> simple_wallet::get_and_verify_passwor
|
||||||
boost::optional<epee::wipeable_string> simple_wallet::new_wallet(const boost::program_options::variables_map& vm,
|
boost::optional<epee::wipeable_string> simple_wallet::new_wallet(const boost::program_options::variables_map& vm,
|
||||||
const crypto::secret_key& recovery_key, bool recover, bool two_random, const std::string &old_language)
|
const crypto::secret_key& recovery_key, bool recover, bool two_random, const std::string &old_language)
|
||||||
{
|
{
|
||||||
auto rc = tools::wallet2::make_new(vm, false, password_prompter);
|
std::pair<std::unique_ptr<tools::wallet2>, tools::password_container> rc;
|
||||||
|
try { rc = tools::wallet2::make_new(vm, false, password_prompter); }
|
||||||
|
catch(const std::exception &e) { fail_msg_writer() << tr("Error creating wallet: ") << e.what(); return {}; }
|
||||||
m_wallet = std::move(rc.first);
|
m_wallet = std::move(rc.first);
|
||||||
if (!m_wallet)
|
if (!m_wallet)
|
||||||
{
|
{
|
||||||
|
@ -4332,7 +4334,9 @@ boost::optional<epee::wipeable_string> simple_wallet::new_wallet(const boost::pr
|
||||||
const cryptonote::account_public_address& address, const boost::optional<crypto::secret_key>& spendkey,
|
const cryptonote::account_public_address& address, const boost::optional<crypto::secret_key>& spendkey,
|
||||||
const crypto::secret_key& viewkey)
|
const crypto::secret_key& viewkey)
|
||||||
{
|
{
|
||||||
auto rc = tools::wallet2::make_new(vm, false, password_prompter);
|
std::pair<std::unique_ptr<tools::wallet2>, tools::password_container> rc;
|
||||||
|
try { rc = tools::wallet2::make_new(vm, false, password_prompter); }
|
||||||
|
catch(const std::exception &e) { fail_msg_writer() << tr("Error creating wallet: ") << e.what(); return {}; }
|
||||||
m_wallet = std::move(rc.first);
|
m_wallet = std::move(rc.first);
|
||||||
if (!m_wallet)
|
if (!m_wallet)
|
||||||
{
|
{
|
||||||
|
@ -4378,7 +4382,9 @@ boost::optional<epee::wipeable_string> simple_wallet::new_wallet(const boost::pr
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
boost::optional<epee::wipeable_string> simple_wallet::new_wallet(const boost::program_options::variables_map& vm)
|
boost::optional<epee::wipeable_string> simple_wallet::new_wallet(const boost::program_options::variables_map& vm)
|
||||||
{
|
{
|
||||||
auto rc = tools::wallet2::make_new(vm, false, password_prompter);
|
std::pair<std::unique_ptr<tools::wallet2>, tools::password_container> rc;
|
||||||
|
try { rc = tools::wallet2::make_new(vm, false, password_prompter); }
|
||||||
|
catch(const std::exception &e) { fail_msg_writer() << tr("Error creating wallet: ") << e.what(); return {}; }
|
||||||
m_wallet = std::move(rc.first);
|
m_wallet = std::move(rc.first);
|
||||||
m_wallet->callback(this);
|
m_wallet->callback(this);
|
||||||
if (!m_wallet)
|
if (!m_wallet)
|
||||||
|
@ -4419,7 +4425,9 @@ boost::optional<epee::wipeable_string> simple_wallet::new_wallet(const boost::pr
|
||||||
boost::optional<epee::wipeable_string> simple_wallet::new_wallet(const boost::program_options::variables_map& vm,
|
boost::optional<epee::wipeable_string> simple_wallet::new_wallet(const boost::program_options::variables_map& vm,
|
||||||
const epee::wipeable_string &multisig_keys, const std::string &old_language)
|
const epee::wipeable_string &multisig_keys, const std::string &old_language)
|
||||||
{
|
{
|
||||||
auto rc = tools::wallet2::make_new(vm, false, password_prompter);
|
std::pair<std::unique_ptr<tools::wallet2>, tools::password_container> rc;
|
||||||
|
try { rc = tools::wallet2::make_new(vm, false, password_prompter); }
|
||||||
|
catch(const std::exception &e) { fail_msg_writer() << tr("Error creating wallet: ") << e.what(); return {}; }
|
||||||
m_wallet = std::move(rc.first);
|
m_wallet = std::move(rc.first);
|
||||||
if (!m_wallet)
|
if (!m_wallet)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue