Skip to main content

Error Handling

The Scompler API uses standard GraphQL error conventions. HTTP status is always 200 — errors are in the response body.

Error Structure

{
"errors": [
{
"message": "You don't have permission to perform this action.",
"locations": [{ "line": 2, "column": 3 }],
"path": ["updateContent"],
"extensions": {
"code": "FORBIDDEN",
"details": {
"requiredScope": "content:write"
}
}
}
]
}

Error Codes Reference

CodeHTTP AnalogyDescription
UNAUTHENTICATED401No valid token provided
FORBIDDEN403Token lacks required permissions
NOT_FOUND404Resource does not exist
VALIDATION_ERROR422Input failed validation
RATE_LIMITED429Too many requests
CONFLICT409Conflicting operation (e.g., duplicate)
INTERNAL_SERVER_ERROR500Unexpected server error

Partial Success

GraphQL allows partial success — some fields succeed while others fail:

{
"data": {
"content": { "id": "...", "title": "..." },
"analytics": null
},
"errors": [{
"message": "Analytics data unavailable",
"path": ["analytics"],
"extensions": { "code": "INTERNAL_SERVER_ERROR" }
}]
}

Always check both data and errors in your response handler.