angzarr_client.router.validation

Build-time semantic validation per handler kind.

R1 catches missing required kwargs at decoration time via keyword-only args. R5 (this module) catches semantic errors: empty strings or empty lists in fields that must be populated.

Duplicate (domain, type_url) across multiple instances is intentionally NOT an error — the unified Router supports “call both”, where all matching handlers are invoked in registration order and their outputs merged.

Functions

validate_handler(→ None)

Raise BuildError if the handler class's metadata is incoherent.

Module Contents

angzarr_client.router.validation.validate_handler(cls: type) None

Raise BuildError if the handler class’s metadata is incoherent.

Called once per registered handler class at build time. Check the kind discriminant (set by the class decorator) and validate kind-specific fields. Operates purely on class-level metadata — no instance required.

Audit #72: BuildError raise sites use the structural error model — code from codes, static message from messages, and runtime context (handler class, field name) in details.