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

## Parameters

| name | type | default | description |
|---|---|---|---|
| `message` | `str` | — | human-readable description of the schema mismatch |

## Example

```python
from lsdtools import SchemaError

try:
    engine.run(clean(t=raw))
except SchemaError as e:
    print("output schema drift:", e)
```

Raise one from a step when the contract is broken:

```python
raise SchemaError("expected column 'score' (int64), got string")
```

## Notes

Subclass of `ValueError`, so `except ValueError` catches it too. It is raised at **run time** — when
a step's produced Arrow table does not match the `output_schema` it declared — not at import or load.
It marks a contract violation between what a step *promised* (its declared schema) and what its
`run()` actually returned.

## See also

**API:** [ValidationError](/docs/api-errors-validationerror) · [Errors](/docs/api-errors) · [Tool](/docs/api-tool)

**Guides:** [Shape steps](/docs/tools-shape) · [Package anatomy](/docs/pkg-anatomy)
