diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-10-28 23:04:24 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-11-14 17:06:29 +0000 |
commit | 437421ce42f1deaa7ec3f28c0c17aff519f1230d (patch) | |
tree | 6aa0d9fc830c7cf03d9b1b8ceabfb5f7fc80aad9 /src/simplewallet/simplewallet.cpp | |
parent | wallet: rejig to avoid prompting in wallet2 (diff) | |
download | monero-437421ce42f1deaa7ec3f28c0c17aff519f1230d.tar.xz |
wallet: move some scoped_message_writer calls from the libs
Diffstat (limited to 'src/simplewallet/simplewallet.cpp')
-rw-r--r-- | src/simplewallet/simplewallet.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 298e60e73..890aec060 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -1501,7 +1501,15 @@ bool simple_wallet::init(const boost::program_options::variables_map& vm) else if (!m_generate_from_json.empty()) { m_wallet_file = m_generate_from_json; - m_wallet = tools::wallet2::make_from_json(vm, m_wallet_file, password_prompter); + try + { + m_wallet = tools::wallet2::make_from_json(vm, m_wallet_file, password_prompter); + } + catch (const std::exception &e) + { + fail_msg_writer() << e.what(); + return false; + } if (!m_wallet) return false; } @@ -5702,6 +5710,7 @@ int main(int argc, char* argv[]) "monero-wallet-cli [--wallet-file=<file>|--generate-new-wallet=<file>] [<COMMAND>]", desc_params, positional_options, + [](const std::string &s, bool emphasis){ tools::scoped_message_writer(emphasis ? epee::console_color_white : epee::console_color_default, true) << s; }, "monero-wallet-cli.log" ); |