Error Codes
PgArachne returns standard JSON-RPC 2.0 error objects. Below are the specific codes you may encounter:
| Code | Message | Meaning |
|---|---|---|
-32700 | Parse error | Invalid JSON was received by the server. |
-32601 | Method not found | The function does not exist in the schema. |
-32602 | Invalid params | Arguments do not match the function signature. |
-32001 | Permission denied | The current user role lacks privileges to execute the function (DB level). |
-32000 | Internal Error | Generic 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
| HTTP | Typical message | When it happens |
|---|---|---|
400 | Invalid JSON request/Invalid function name | Malformed request payload or method format. |
401 | Authorization header is missing/Invalid or expired token | Missing or invalid auth. |
403 | Permission denied for the specified role | SET LOCAL ROLE failed (-32001). |
404 | Function does not exist | Target method is missing. |
429 | Too many login attempts | Login rate limit exceeded. |
500 | Function call failed/Transaction commit failed | Execution or commit failed. |
503 | Database connection failed/Database unavailable | Database or listener temporarily unavailable. |