Skip to main content

Error Codes

ONQL returns errors as JSON with a short, machine-readable code and a human-readable message.

{
"error": {
"code": "UNKNOWN_IDENTIFIER",
"message": "unknown identifier accounts after table data"
}
}

Parser errors

CodeMeaning
UNEXPECTED_TOKENThe lexer found a character it didn't recognise
EXPECT_IDENTIFIERThe parser expected a name
EXPECT_DATABASEFirst token wasn't a known database
EXPECT_TABLEAfter db., the next token wasn't a known table
EXPECT_BRACEMissing { or }
EXPECT_BRACKETMissing [ or ]
UNKNOWN_IDENTIFIERA name didn't match any column, relation, or aggregate

Type errors

CodeMeaning
INVALID_OPERAND_TYPEA comparison got an operand of the wrong type
INVALID_AGGREGATE_INPUTAn aggregate received an input it can't handle
EXPECT_ARRAYA row-access or slice was applied to a non-array

Protocol errors

CodeMeaning
PROTOCOL_NOT_FOUNDThe protopass doesn't match a known protocol
ENTITY_NOT_FOUNDThe protocol doesn't define this entity
RELATION_NOT_FOUNDA relation in the query isn't defined for the entity
CONTEXT_NOT_FOUNDThe ctxkey isn't defined for the entity
CONTEXT_PARAM_MISMATCHThe context rule expected more ctxvalues than were sent

Storage errors

CodeMeaning
KEY_NOT_FOUNDA direct PK lookup found nothing
INDEX_MISSINGAn index expected by the query plan didn't exist
STORAGE_TIMEOUTThe storage layer didn't respond in time

Runtime safety

CodeMeaning
INTERNAL_PANICA bug — please file an issue
QUERY_TIMEOUTThe query took longer than the configured limit