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/wallet/wallet_rpc_server.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 '')
-rw-r--r-- | src/wallet/wallet_rpc_server.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index 9dc2baea6..173cc7bbe 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -38,6 +38,7 @@ using namespace epee; #include "wallet/wallet_args.h" #include "common/command_line.h" #include "common/i18n.h" +#include "common/scoped_message_writer.h" #include "cryptonote_basic/cryptonote_format_utils.h" #include "cryptonote_basic/account.h" #include "wallet_rpc_server_commands_defs.h" @@ -1981,6 +1982,7 @@ int main(int argc, char** argv) { "monero-wallet-rpc [--wallet-file=<file>|--generate-from-json=<file>|--wallet-dir=<directory>] [--rpc-bind-port=<port>]", desc_params, po::positional_options_description(), + [](const std::string &s, bool emphasis){ tools::scoped_message_writer(emphasis ? epee::console_color_white : epee::console_color_default, true) << s; }, "monero-wallet-rpc.log", true ); @@ -2021,7 +2023,15 @@ int main(int argc, char** argv) { } else { - wal = tools::wallet2::make_from_json(*vm, from_json, password_prompter); + try + { + wal = tools::wallet2::make_from_json(*vm, from_json, password_prompter); + } + catch (const std::exception &e) + { + MERROR("Error creating wallet: " << e.what()); + return 1; + } } if (!wal) { |