All docs
Errors
ValidationError and SchemaError are the two typed failures lsdtools surfaces at run time — a rejected parameter, or a step's output schema mismatch.
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#
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 · Params & actions · Custom views · Package anatomy
API — ValidationError · SchemaError · Tool
Examples — A dockable panel
Errors
- SchemaError signals a step's output not matching its declared output_schema
- ValidationError records one parameter validation failure — its name, message, and value