feat: More verbose forwarding errors (#1523)

Fixes #1516.
This commit is contained in:
Sergey Kuznetsov
2024-07-09 15:22:01 +01:00
committed by GitHub
parent 094ed8f299
commit 46bd67a9ec
19 changed files with 176 additions and 53 deletions

View File

@@ -99,6 +99,11 @@ getErrorInfo(ClioError code)
{ClioError::rpcCOMMAND_NOT_STRING, "commandNotString", "Method is not a string."},
{ClioError::rpcCOMMAND_IS_EMPTY, "emptyCommand", "Method is an empty string."},
{ClioError::rpcPARAMS_UNPARSEABLE, "paramsUnparseable", "Params must be an array holding exactly one object."},
// etl related errors
{ClioError::etlCONNECTION_ERROR, "connectionError", "Couldn't connect to rippled."},
{ClioError::etlREQUEST_ERROR, "requestError", "Error sending request to rippled."},
{ClioError::etlREQUEST_TIMEOUT, "timeout", "Request to rippled timed out."},
{ClioError::etlINVALID_RESPONSE, "invalidResponse", "Rippled returned an invalid response."}
};
auto matchByCode = [code](auto const& info) { return info.code == code; };