Return appropriate error code when there's no connection to daemon

This commit is contained in:
Michał Sałaban 2018-01-29 08:28:25 +01:00
parent 3cb65b3f69
commit f90c76beb4
2 changed files with 6 additions and 0 deletions

View File

@ -2397,6 +2397,11 @@ namespace tools
{ {
std::rethrow_exception(e); 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) catch (const tools::error::daemon_busy& e)
{ {
er.code = WALLET_RPC_ERROR_CODE_DAEMON_IS_BUSY; er.code = WALLET_RPC_ERROR_CODE_DAEMON_IS_BUSY;

View File

@ -68,3 +68,4 @@
#define WALLET_RPC_ERROR_CODE_MULTISIG_SIGNATURE -35 #define WALLET_RPC_ERROR_CODE_MULTISIG_SIGNATURE -35
#define WALLET_RPC_ERROR_CODE_MULTISIG_SUBMISSION -36 #define WALLET_RPC_ERROR_CODE_MULTISIG_SUBMISSION -36
#define WALLET_RPC_ERROR_CODE_NOT_ENOUGH_UNLOCKED_MONEY -37 #define WALLET_RPC_ERROR_CODE_NOT_ENOUGH_UNLOCKED_MONEY -37
#define WALLET_RPC_ERROR_CODE_NO_DAEMON_CONNECTION -38