diff options
| author | John Newbery <[email protected]> | 2017-02-09 16:27:28 -0500 |
|---|---|---|
| committer | Luke Dashjr <[email protected]> | 2017-06-05 19:01:16 +0000 |
| commit | 18c109ddb10e8f2e1075ee4078519cfefd4de47d (patch) | |
| tree | be5ac35545f41f0ae0f63a455bd3858087aedf0e /src/wallet/rpcdump.cpp | |
| parent | Return correct error codes in blockchain.cpp. (diff) | |
| download | discoin-18c109ddb10e8f2e1075ee4078519cfefd4de47d.tar.xz discoin-18c109ddb10e8f2e1075ee4078519cfefd4de47d.zip | |
Return correct error codes in removeprunedfunds().
The removeprunedfunds() RPC was returning misleading or incorrect error
codes (for example RPC_INTERNAL_ERROR when the transaction was
not found in the wallet). This commit fixes those error codes:
- RPC_INTERNAL_ERROR should not be returned for application-level
errors, only for genuine internal errors such as corrupted data.
This error code has been replaced with RPC_WALLET_ERROR.
This commit also updates the test cases to explicitly test the error code.
Github-Pull: #9853
Rebased-From: 960bc7f778d8dd618e65f1e37ec734e2d4734051
Diffstat (limited to 'src/wallet/rpcdump.cpp')
| -rw-r--r-- | src/wallet/rpcdump.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp index cd6ec207f..dc61a4505 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -340,11 +340,11 @@ UniValue removeprunedfunds(const JSONRPCRequest& request) vector<uint256> vHashOut; if(pwalletMain->ZapSelectTx(vHash, vHashOut) != DB_LOAD_OK) { - throw JSONRPCError(RPC_INTERNAL_ERROR, "Could not properly delete the transaction."); + throw JSONRPCError(RPC_WALLET_ERROR, "Could not properly delete the transaction."); } if(vHashOut.empty()) { - throw JSONRPCError(RPC_INTERNAL_ERROR, "Transaction does not exist in wallet."); + throw JSONRPCError(RPC_INVALID_PARAMETER, "Transaction does not exist in wallet."); } return NullUniValue; |