Exceptions¶
bcql_py.exceptions
¶
Custom exceptions and validation issue types for bcql_py.
BCQLSyntaxError
¶
Bases: Exception
A syntax error with optional source and position, raised when tokenization or parsing of a BCQL query fails.
Attributes:
| Name | Type | Description |
|---|---|---|
error_message |
Human-readable parse or lexing error message. |
|
bcql_query |
Original BCQL source query. |
|
error_position |
0-based character position in |
View source on GitHub: src/bcql_py/exceptions.py lines 21–31
__str__
¶
Return a readable message including a caret position when available.
View source on GitHub: src/bcql_py/exceptions.py lines 33–41
ValidationIssue
dataclass
¶
A single semantic validation problem found during validate(). In practice, there may be multiple issues collected in a BCQLValidationError to report them all at once instead of just the first one.
Attributes:
| Name | Type | Description |
|---|---|---|
kind |
IssueKind
|
A short machine-readable label identifying the issue category. |
message |
str
|
Human-readable description of the problem. |
node_type |
str
|
The |
context |
dict[str, Any]
|
Extra context (e.g. the offending annotation name, value, or tag). |
__str__
¶
Return this issue as a compact single-line message.
View source on GitHub: src/bcql_py/exceptions.py lines 75–80
BCQLValidationError
¶
Bases: Exception
Raised when an AST does not satisfy a CorpusSpec.
Collects one or more ValidationIssue instances so that callers can surface
every problem at once (when fail_fast=False) or just the first (default).
Attributes:
| Name | Type | Description |
|---|---|---|
issues |
List of ValidationIssue entries describing what went wrong. |
View source on GitHub: src/bcql_py/exceptions.py lines 93–99
__str__
¶
Return one issue or a multi-line list of all validation issues as a string.
View source on GitHub: src/bcql_py/exceptions.py lines 101–107