# errors

URL: /kida/api/parser/errors/
Section: parser
Description: Parser error handling for Kida.

Provides ParseError class with rich source context and suggestions.

---

> For a complete page index, fetch /kida/llms.txt.

Open LLM text
(/kida/api/parser/errors/index.txt)

Share with AI

Ask Claude
(https://claude.ai/new?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fkida%2Fapi%2Fparser%2Ferrors%2Findex.txt)

Ask ChatGPT
(https://chatgpt.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fkida%2Fapi%2Fparser%2Ferrors%2Findex.txt)

Ask Gemini
(https://gemini.google.com/app?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fkida%2Fapi%2Fparser%2Ferrors%2Findex.txt)

Ask Copilot
(https://copilot.microsoft.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fkida%2Fapi%2Fparser%2Ferrors%2Findex.txt)

Module

#
`parser.errors`

Parser error handling for Kida.

Provides ParseError class with rich source context and suggestions.

1Class

## Classes

`ParseError`

5

▼

Parser error with rich source context.

Inherits from TemplateSyntaxError to ensure consistent exce…

Parser error with rich source context.

Inherits from TemplateSyntaxError to ensure consistent exception handling.
Displays errors with source code snippets and visual pointers,
matching the format used by the lexer for consistency.

#### Methods

`col_offset`

0

`int`

▼

Column offset where the error occurred (0-based).

property

`def col_offset(self) -> int`

##### Returns

`int`

`col_offset`

1

▼

Allow parent __init__ to set col_offset without clobbering token value.

`def col_offset(self, value: int | None) -> None`

##### Parameters

Name
Type
Description

`value`
`—`

Internal Methods
3

▼

`__init__`

6

▼

`def __init__(self, message: str, token: Token, source: str | None = None, filename: str | None = None, suggestion: str | None = None, code: ErrorCode | None = None)`

##### Parameters

Name
Type
Description

`message`
`—`

`token`
`—`

`source`
`—`

Default:`None`

`filename`
`—`

Default:`None`

`suggestion`
`—`

Default:`None`

`code`
`—`

Default:`None`

`_format_message`

0

`str`

▼

Override parent's formatting with rich source context.

`def _format_message(self) -> str`

##### Returns

`str`

`_format`

0

`str`

▼

Format error with source context like Rust/modern compilers.

`def _format(self) -> str`

##### Returns

`str`
