Skip to main content

max / audiofiles

853 B · 32 lines History Blame Raw
1 //! Error types for the plugin system.
2
3 use thiserror::Error;
4
5 /// Errors that can occur when loading or running device plugins.
6 #[derive(Error, Debug)]
7 pub enum PluginError {
8 /// TOML manifest could not be parsed.
9 #[error("manifest parse error: {0}")]
10 ManifestParse(String),
11
12 /// Manifest is missing a required field.
13 #[error("manifest missing field: {0}")]
14 ManifestMissing(String),
15
16 /// Manifest contains an invalid value.
17 #[error("manifest invalid value: {0}")]
18 ManifestInvalid(String),
19
20 /// Rhai script compilation error.
21 #[error("script compile error: {0}")]
22 ScriptCompile(String),
23
24 /// Rhai script runtime error.
25 #[error("script runtime error: {0}")]
26 ScriptRuntime(String),
27
28 /// I/O error loading plugin files.
29 #[error("plugin I/O error: {0}")]
30 Io(#[from] std::io::Error),
31 }
32