Skip to main content

Module errors

Module errors 

Source
Expand description

Engine error surfaces — both build-time and runtime.

This module defines two intentionally separate enums so callers can match on the surface they actually expect to see:

  • EngineConstructionError — build-time configuration defects surfaced by Engine::new (rewrite cycles, unannotated custom axes, unknown / conflicting rule overrides). The integrator resolves these before shipping; runtime lint / fix never emits them.

  • EngineError — runtime conditions raised by Engine::lint_with_options / Engine::fix_with_options (spec 005). Variants: DeadlineExceeded { partial_lint } and InvalidThreshold(_). #[non_exhaustive] so future runtime conditions (memory budgets, per-rule deadlines, cancellation tokens) can land non-breaking. Phase 1 status: the type surface ships, but DeadlineExceeded cannot currently fire — fix_with_options ignores opts.deadline until Phase 2 wiring lands (tasks T010–T012). Only InvalidThreshold is observable today.

Keeping the two enums separate means matching on one does not force callers to pattern against variants they could never encounter at the corresponding lifecycle stage.

EngineConstructionError’s RewriteCycle and UnannotatedCustomAxes variants are emitted by the Phase 3 scheduler (Engine::new runs Kahn’s algorithm over PageRewrite::reads / writes); UnknownRuleOverride and ConflictingRuleOverride come from the rule-override canonicalization pass that runs immediately afterward.

Enums§

EngineConstructionError
Errors that will be raised while constructing an Engine.
EngineError
Runtime errors from Engine::lint_with_options / Engine::fix_with_options (spec 005).