Skip to main content

Module error

Module error 

Source
Expand description

PluginError covers every failure mode described in docs/specs/plugin-api.md §Edge cases.

Load-time errors (Compile, UnknownDataDep, MalformedDataDeps, IdCollision) are collected in a Vec<PluginError> by the registry and surfaced via linesmith doctor. Runtime errors (Runtime, ResourceExceeded, Timeout, MalformedReturn) drop the plugin segment for one render invocation and log once to stderr.

Enums§

CollisionWinner
What “won” an PluginError::IdCollision — either a built-in segment (which plugins can never shadow) or another plugin (keyed by path). Avoids the stringly-typed PathBuf::from("<built-in>") sentinel used before.
PluginError
Every failure mode a plugin can hit at load time or render time. Variants match plugin-api.md §Edge cases; error copy is aimed at the person reading linesmith doctor output, not the plugin author’s script.
ResourceLimit
Which of the configured rhai resource ceilings tripped. One-to-one with the MAX_* constants in crate::engine; a typed enum here (rather than &'static str) keeps PluginError::ResourceExceeded and linesmith doctor output typo-proof.