aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Sałaban <michal@salaban.info>2018-01-29 08:28:25 +0100
committerMichał Sałaban <michal@salaban.info>2018-01-29 08:28:25 +0100
commitf90c76beb4ae247178518f5097a580b5971374bb (patch)
treeee219db0f0587cc633a86f8cd5fce5efa2759113
parentReturn appropriate error code when not enough money for tx (diff)
downloadmonero-f90c76beb4ae247178518f5097a580b5971374bb.tar.xz
Return appropriate error code when there's no connection to daemon
-rw-r--r--src/wallet/wallet_rpc_server.cpp5
-rw-r--r--src/wallet/wallet_rpc_server_error_codes.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp
index f995465d2..17ddee238 100644
--- a/src/wallet/wallet_rpc_server.cpp
+++ b/src/wallet/wallet_rpc_server.cpp
@@ -2397,6 +2397,11 @@ namespace tools
{
std::rethrow_exception(e);
}
+ catch (const tools::error::no_connection_to_daemon& e)
+ {
+ er.code = WALLET_RPC_ERROR_CODE_NO_DAEMON_CONNECTION;
+ er.message = e.what();
+ }
catch (const tools::error::daemon_busy& e)
{
er.code = WALLET_RPC_ERROR_CODE_DAEMON_IS_BUSY;
diff --git a/src/wallet/wallet_rpc_server_error_codes.h b/src/wallet/wallet_rpc_server_error_codes.h
index 462b8fbbf..38c464895 100644
--- a/src/wallet/wallet_rpc_server_error_codes.h
+++ b/src/wallet/wallet_rpc_server_error_codes.h
@@ -68,3 +68,4 @@
#define WALLET_RPC_ERROR_CODE_MULTISIG_SIGNATURE -35
#define WALLET_RPC_ERROR_CODE_MULTISIG_SUBMISSION -36
#define WALLET_RPC_ERROR_CODE_NOT_ENOUGH_UNLOCKED_MONEY -37
+#define WALLET_RPC_ERROR_CODE_NO_DAEMON_CONNECTION -38