# Errors
URL: https://lsd.tools/docs/api-errors
Updated: 2026-07-18

`lsdtools` surfaces two typed failures, both importable from `lsdtools`. They exist to make failures
deterministic and self-explaining — each carries enough structure (a parameter name, message, and
value; or a schema mismatch) that authors, CI, and AI agents know exactly where to look. Both live at
**run time**: a rejected parameter value is *recorded* as a `ValidationError` (a dataclass, collected
in a `ValidationResult`), while output that drifts from a step's declared `output_schema` is *raised*
as a `SchemaError`.

## Usage

```python
from lsdtools import ValidationError, SchemaError

# ValidationError is a record you inspect — not something you `except`:
err = ValidationError(parameter="cutoff", message="must be ≥ 0", value=-3)

# SchemaError is raised when a step's output drifts from its declared schema:
raise SchemaError("expected column 'score' (int64), got string")
```

## Where to start

**Learn** — [UI overview](/docs/ui-overview) · [Params & actions](/docs/ui-panels) · [Custom views](/docs/ui-custom-views) · [Package anatomy](/docs/pkg-anatomy)

**API** — [ValidationError](/docs/api-errors-validationerror) · [SchemaError](/docs/api-errors-schemaerror) · [Tool](/docs/api-tool)

**Examples** — [A dockable panel](/docs/ex-panel)
