Skip to main content
Hardwave uses a typed exception hierarchy for wiring and configuration errors, and a structured Diagnostic system for both pre-run validation and runtime component health events.

Exception hierarchy

Premium components add a separate hierarchy under PremiumError:

Diagnostic levels

Each Diagnostic carries:

Graph validation

GraphValidationError carries a full list of Diagnostic objects:

Common wiring errors

Validation checklist

Before calling engine.run(), ensure every required input port is:
  1. Connected to an upstream output, or
  2. Has a default value, or
  3. Appears in the inputs dict passed to run() (and validate())

Runtime component faults

During simulation, components with fault rules emit WARNING and FAULT diagnostics. These are collected in SimulationResult. They do not raise exceptions unless fault_mode=STOP.

Built-in fault codes (stdlib)

DCMotor LiPoCell See Component Faults and Health for parameters, degraded output behaviour, and how to add faults to custom components.

Simulation errors

Deserialization

DeserializationError is raised when loading a saved graph with an unknown component class, incompatible schema version, or corrupt JSON. Ensure all custom components are registered before calling SimulationGraph.from_dict().