Error Handling
Error Handling
Plings follows GraphQL best-practices for surfacing errors to clients while safeguarding internal details.
GraphQL Error Shape
{
"errors": [
{
"message": "Access denied: You do not have permission to view this object.",
"path": ["object"],
"extensions": { "code": "FORBIDDEN" }
}
],
"data": { "object": null }
}
Guidelines
- Sanitise Messages – Never leak stack traces in production.
- Error Codes – Use stable
extensions.codevalues that clients can rely on (FORBIDDEN,UNAUTHENTICATED,BAD_INPUT,RATE_LIMITED, etc.). - HTTP Status – Always
200 OK; errors are in the JSON payload per GraphQL spec. - Logging – Internal logs capture full traceback & request metadata.
- RLS Violations – Supabase returns
42501(insufficient privilege) which is translated toFORBIDDENat the resolver boundary.
Status: skeleton v0.1 – will include mapping table of Postgres/Neo4j error codes to GraphQL once finalised.