From 5420f4858052bd00d86b19380755ed8eec5d2770 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 20 Feb 2025 14:33:40 +0000 Subject: Use an enum for standard RPC error codes. --- include/modules/rpc.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/modules') diff --git a/include/modules/rpc.h b/include/modules/rpc.h index 35db305c7..68523e5fa 100644 --- a/include/modules/rpc.h +++ b/include/modules/rpc.h @@ -12,6 +12,19 @@ #include +namespace RPC +{ + /** Represents standard RPC errors from the JSON-RPC and XML-RPC specifications. */ + enum Error + : int64_t + { + ERR_PARSE_ERROR = -32700, + ERR_INVALID_REQUEST = -32600, + ERR_METHOD_NOT_FOUND = -32601, + ERR_INVALID_PARAMS = -32602, + }; +} + class RPCBlock { public: -- cgit