1 min read

Error Codes

PgArachne returns standard JSON-RPC 2.0 error objects. Below are the specific codes you may encounter:

CodeMessageMeaning
-32700Parse errorInvalid JSON was received by the server.
-32601Method not foundThe function does not exist in the schema.
-32602Invalid paramsArguments do not match the function signature.
-32001Permission deniedThe current user role lacks privileges to execute the function (DB level).
-32000Internal ErrorGeneric server error (check logs).
Current behavior: runtime responses are primarily mapped to HTTP status codes with a JSON-RPC error message. Custom JSON-RPC code -32001 is used for role/permission denial.

HTTP Status Mapping

HTTPTypical messageWhen it happens
400Invalid JSON request/Invalid function nameMalformed request payload or method format.
401Authorization header is missing/Invalid or expired tokenMissing or invalid auth.
403Permission denied for the specified roleSET LOCAL ROLE failed (-32001).
404Function does not existTarget method is missing.
429Too many login attemptsLogin rate limit exceeded.
500Function call failed/Transaction commit failedExecution or commit failed.
503Database connection failed/Database unavailableDatabase or listener temporarily unavailable.

See also