> For the complete documentation index, see [llms.txt](https://docs.internetobject.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.internetobject.org/parsing-and-errors/parser-behavior.md).

# Parser Behavior & Recovery

A conformant processor SHOULD recover from errors and continue, so that a single bad record does not discard the rest of a document.

## Syntax-error recovery is bounded by structure

On a syntax error, the parser **skips tokens until the next boundary** and resumes there. The boundaries are:

* the record separator `~` (start of the next collection item), and
* the section separator `---` (start of the next section),
* or end of input.

```ruby
~ $schema: { name: string, age: int }
---
~ John, 28              # parsed
~ Bad, { unclosed      # syntax error here; parser skips to the next ~
~ Bob, 35              # parsed — recovery resumed at this record
```

The malformed middle record is reported as an error; the records before and after it are still parsed.

## Validation recovery is bounded by the object

Each record is validated independently. A validation error in one record does not stop validation of the others (see [Collection Rules](/collections/collection-rules.md)).

## Processing options

A processor typically offers options that control recovery and output. Common ones:

* **continue-on-error** — collect errors and keep going (recommended), versus failing on the first error.
* **skip-errors** — omit error entries from the loaded result, returning only the records that succeeded.

> Option names and exact semantics are implementation-defined; this section describes the behaviors a conformant processor is expected to provide.

## Error nodes

When continuing past an error, a processor marks the failed record with an error placeholder in the result so consumers can tell which records succeeded and which did not. See [Error Accumulation](/parsing-and-errors/error-accumulation.md).

## See Also

* [Error Model](/parsing-and-errors/error-model.md) · [Error Accumulation](/parsing-and-errors/error-accumulation.md)
* [Syntax Errors](/structure-and-syntax/syntax-errors.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.internetobject.org/parsing-and-errors/parser-behavior.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
