1
0
mirror of https://github.com/anope/anope.git synced 2026-07-09 14:43:13 +02:00

Use an enum for standard RPC error codes.

This commit is contained in:
Sadie Powell
2025-02-20 14:33:40 +00:00
parent 5967bf4176
commit 5420f48580
4 changed files with 24 additions and 11 deletions
+2 -2
View File
@@ -135,7 +135,7 @@ public:
auto event = this->events.find(request.name);
if (event == this->events.end())
{
xmlrpc_env_set_fault(&env, -32601, "Method not found");
xmlrpc_env_set_fault(&env, RPC::ERR_METHOD_NOT_FOUND, "Method not found");
SendError(reply, env);
return true;
}
@@ -150,7 +150,7 @@ public:
if (xmlrpc_value_type(value) != XMLRPC_TYPE_STRING)
{
// TODO: error;
xmlrpc_env_set_fault(&env, 0, "Anope XML-RPC only supports strings");
xmlrpc_env_set_fault(&env, RPC::ERR_INVALID_REQUEST, "Anope XML-RPC only supports strings");
SendError(reply, env);
xmlrpc_DECREF(value);
xmlrpc_DECREF(params);