Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Error Handling

preader uses a single Error enum in Rust and a small exception hierarchy in Python. Both report the same conditions through each language’s idiomatic error mechanism: Result<T, Error> in Rust and raised exceptions in Python

Most errors you will encounter in practice fall into two categories: state mismatches (the file changed since you saved your position) and I/O errors (permissions, missing files). State mismatches are recoverable with a resync or a fresh start; I/O errors are usually environmental

Every exception in Python carries a name property with the state name involved, so you can decide what to do per state

The pages below cover every error variant, how they map across languages, and the standard recovery patterns

  • ⚠️ Error Types: Every error variant and exception class, with the Rust-to-Python mapping
  • 🛠️ Recovery Patterns: How to handle outdated, corrupt, and mismatched states
  • 🏷️ State Names: Validation rules for state names and what triggers a name error