Skip to content

Error codes

Sluice puts one of these codes in the code field of an error response. MCP tool errors use the same codes. REST API shows the response body.

Code HTTP status Meaning
ERR_SYNTAX 400 SQL parse error
ERR_MULTIPLE_STATEMENTS 400 Only a single statement is allowed per request
ERR_UNSUPPORTED_SYNTAX 400 SQL feature not supported
ERR_REWRITE_FAILED 400 Policy rewrite failed
ERR_MASK_UNSUPPORTED_CONTEXT 400 A post-query masked column is used outside a bare select item
ERR_UNAUTHORIZED 401 Authentication required
ACL_DENIED 403 Access denied by policy
ACL_REJECTED 403 Query shape rejected by policy
ERR_DATASOURCE_UNAVAILABLE 503 Data source unavailable
ERR_POLICY_UNAVAILABLE 503 Policy engine unavailable; request refused (fail-closed)
ERR_CONFIG_INVALID 400 Server configuration invalid
ERR_POLICY_INVALID 400 Policy document invalid
ERR_TIMEOUT 504 Request timed out
ERR_CANCELED 499 Request canceled
ERR_QUERY_FAILED 400 The database rejected the query
ERR_RATE_LIMITED 429 Too many requests
ERR_BUDGET_EXCEEDED 429 Query budget exceeded
ERR_PAYLOAD_TOO_LARGE 413 Payload too large
ERR_RESULT_TRUNCATED 200 Result truncated
ERR_AUDIT_UNAVAILABLE 503 Audit log unavailable; request refused (fail-closed)
ERR_APPROVAL_PENDING 202 Query requires human approval; awaiting decision
ERR_APPROVAL_REJECTED 403 Query rejected by an approver
ERR_APPROVAL_EXPIRED 410 Approval request expired before a decision was made
ERR_INTERNAL 500 Internal error
  • ERR_RESULT_TRUNCATED is a warning in a successful response, not an error.
  • A policy can replace ACL_DENIED or ACL_REJECTED with its own code. The HTTP status stays 403.
  • Only POST /admin/reload returns ERR_CONFIG_INVALID and ERR_POLICY_INVALID.