跳转至

Errors#

nlql.errors —— 类型化异常层级,根 NLQLError,让调用方能按错误阶段精确捕获(解析 / Schema / 注册 / 类型 / 计划 / 执行)。所有 public 错误派生自 NLQLError

errors #

Exception hierarchy for NLQL.

All public errors derive from :class:NLQLError so callers can catch the whole family with a single except. Each stage of the pipeline (parse → validate → plan → execute) raises its own specific subclass.

NLQLError #

Bases: Exception

Base class for every error raised by NLQL.

NLQLParseError #

NLQLParseError(message: str, *, line: int | None = None, column: int | None = None, context: str | None = None)

Bases: NLQLError

Raised when an NLQL string cannot be parsed.

Carries optional source-location info so front-ends can render a helpful pointer at the offending token.

源代码位于: src/nlql/errors.py
def __init__(
    self,
    message: str,
    *,
    line: int | None = None,
    column: int | None = None,
    context: str | None = None,
) -> None:
    self.message = message
    self.line = line
    self.column = column
    self.context = context
    location = ""
    if line is not None:
        location = f" (line {line}" + (f", column {column}" if column is not None else "") + ")"
    full = f"{message}{location}"
    if context:
        full = f"{full}\n{context}"
    super().__init__(full)

message instance-attribute #

message = message

line instance-attribute #

line = line

column instance-attribute #

column = column

context instance-attribute #

context = context

NLQLSchemaError #

Bases: NLQLError

Raised when a Query IR document is structurally invalid.

NLQLRegistryError #

Bases: NLQLError

Raised on invalid registration or lookup of a capability.

NLQLTypeError #

Bases: NLQLError

Raised when a comparison / function receives incompatible operand types.

NLQLPlanError #

Bases: NLQLError

Raised when a query cannot be planned against the target store.

NLQLExecutionError #

Bases: NLQLError

Raised when evaluating a planned query fails at runtime.

NLQLEmbeddingError #

Bases: NLQLError

Raised when an embedder backend fails to produce vectors.