monero-wallet-cli: improve error message when tx amount is zero

This commit is contained in:
Elliot Wirrick 2021-04-06 06:29:06 -04:00
parent 9a5579fc4f
commit c8ff1d4d23
6 changed files with 30 additions and 8 deletions

View file

@ -822,7 +822,7 @@ namespace tools
if (at_least_one_destination && dsts.empty())
{
er.code = WALLET_RPC_ERROR_CODE_ZERO_DESTINATION;
er.message = "No destinations for this transfer";
er.message = "Transaction has no destination";
return false;
}
@ -3359,6 +3359,11 @@ namespace tools
er.code = WALLET_RPC_ERROR_CODE_DAEMON_IS_BUSY;
er.message = e.what();
}
catch (const tools::error::zero_amount& e)
{
er.code = WALLET_RPC_ERROR_CODE_ZERO_AMOUNT;
er.message = e.what();
}
catch (const tools::error::zero_destination& e)
{
er.code = WALLET_RPC_ERROR_CODE_ZERO_DESTINATION;