mirror of
https://github.com/XRPLF/clio.git
synced 2025-12-06 17:27:58 +00:00
@@ -80,6 +80,8 @@ getErrorInfo(ClioError code)
|
||||
{ClioError::rpcMALFORMED_ADDRESS, "malformedAddress", "Malformed address."},
|
||||
{ClioError::rpcINVALID_HOT_WALLET, "invalidHotWallet", "Invalid hot wallet."},
|
||||
{ClioError::rpcUNKNOWN_OPTION, "unknownOption", "Unknown option."},
|
||||
{ClioError::rpcFIELD_NOT_FOUND_TRANSACTION, "fieldNotFoundTransaction", "Missing field."},
|
||||
// special system errors
|
||||
{ClioError::rpcINVALID_API_VERSION, JS(invalid_API_version), "Invalid API version."},
|
||||
{ClioError::rpcCOMMAND_IS_MISSING, JS(missingCommand), "Method is not specified or is not a string."},
|
||||
{ClioError::rpcCOMMAND_NOT_STRING, "commandNotString", "Method is not a string."},
|
||||
|
||||
@@ -41,6 +41,7 @@ enum class ClioError {
|
||||
rpcMALFORMED_ADDRESS = 5003,
|
||||
rpcINVALID_HOT_WALLET = 5004,
|
||||
rpcUNKNOWN_OPTION = 5005,
|
||||
rpcFIELD_NOT_FOUND_TRANSACTION = 5006,
|
||||
|
||||
// special system errors start with 6000
|
||||
rpcINVALID_API_VERSION = 6000,
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include <backend/BackendInterface.h>
|
||||
#include <rpc/RPCHelpers.h>
|
||||
#include <rpc/common/MetaProcessors.h>
|
||||
#include <rpc/common/Types.h>
|
||||
#include <rpc/common/Validators.h>
|
||||
|
||||
@@ -65,7 +66,9 @@ public:
|
||||
spec([[maybe_unused]] uint32_t apiVersion) const
|
||||
{
|
||||
static auto const rpcSpec = RpcSpec{
|
||||
{JS(tx_hash), validation::Required{}, validation::Uint256HexStringValidator},
|
||||
{JS(tx_hash),
|
||||
meta::WithCustomError{validation::Required{}, Status(ClioError::rpcFIELD_NOT_FOUND_TRANSACTION)},
|
||||
validation::Uint256HexStringValidator},
|
||||
{JS(ledger_hash), validation::Uint256HexStringValidator},
|
||||
{JS(ledger_index), validation::LedgerIndexValidator},
|
||||
};
|
||||
|
||||
@@ -85,6 +85,7 @@ public:
|
||||
case RPC::ClioError::rpcMALFORMED_OWNER:
|
||||
case RPC::ClioError::rpcMALFORMED_ADDRESS:
|
||||
case RPC::ClioError::rpcINVALID_HOT_WALLET:
|
||||
case RPC::ClioError::rpcFIELD_NOT_FOUND_TRANSACTION:
|
||||
assert(false); // this should never happen
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user