Unknown Option (#710)

Fixes #711
This commit is contained in:
cyan317
2023-07-03 11:02:14 +01:00
committed by GitHub
parent ef62718a27
commit 1e969ba13b
4 changed files with 7 additions and 4 deletions

View File

@@ -79,7 +79,9 @@ getErrorInfo(ClioError code)
{ClioError::rpcMALFORMED_OWNER, "malformedOwner", "Malformed owner."},
{ClioError::rpcMALFORMED_ADDRESS, "malformedAddress", "Malformed address."},
{ClioError::rpcINVALID_HOT_WALLET, "invalidHotWallet", "Invalid hot wallet."},
{ClioError::rpcINVALID_API_VERSION, JS(invalid_API_version), "Invalid API version."}};
{ClioError::rpcUNKNOWN_OPTION, "unknownOption", "Unknown option."},
{ClioError::rpcINVALID_API_VERSION, JS(invalid_API_version), "Invalid API version."},
};
auto matchByCode = [code](auto const& info) { return info.code == code; };
if (auto it = find_if(begin(infos), end(infos), matchByCode); it != end(infos))

View File

@@ -40,6 +40,7 @@ enum class ClioError {
rpcMALFORMED_OWNER = 5002,
rpcMALFORMED_ADDRESS = 5003,
rpcINVALID_HOT_WALLET = 5004,
rpcUNKNOWN_OPTION = 5005,
// special system errors start with 6000
rpcINVALID_API_VERSION = 6000,

View File

@@ -82,7 +82,7 @@ LedgerEntryHandler::process(LedgerEntryHandler::Input input, Context const& ctx)
else
{
// Must specify 1 of the following fields to indicate what type
return Error{Status{RippledError::rpcINVALID_PARAMS, "unknownOption"}};
return Error{Status{ClioError::rpcUNKNOWN_OPTION}};
}
// check ledger exists

View File

@@ -99,8 +99,8 @@ generateTestValuesForParametersTest()
"UnknownOption",
R"({
})",
"invalidParams",
"unknownOption"},
"unknownOption",
"Unknown option."},
ParamTestCaseBundle{
"InvalidDepositPreauthType",