diff options
Diffstat (limited to 'crates/core/tedge_api/src/error.rs')
-rw-r--r-- | crates/core/tedge_api/src/error.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/crates/core/tedge_api/src/error.rs b/crates/core/tedge_api/src/error.rs new file mode 100644 index 00000000..7f6c8f8e --- /dev/null +++ b/crates/core/tedge_api/src/error.rs @@ -0,0 +1,17 @@ +use miette::Diagnostic; +use thiserror::Error; + +/// Errors as orginating from [`Plugin`](crate::Plugin) and [`PluginBuilder`](crate::PluginBuilder) +pub type PluginError = miette::Report; + +#[derive(Error, Debug, Diagnostic)] +/// An error occured while interfacing with the [`PluginDirectory`](crate::plugin::PluginDirectory) +pub enum DirectoryError { + /// The given plugin name does not exist in the configuration + #[error("Plugin named '{}' not found", .0)] + PluginNameNotFound(String), + + /// The given plugin does not support all requested message types + #[error("Plugin '{}' does not support the following message types: {}", .0 ,.1.join(","))] + PluginDoesNotSupport(String, Vec<&'static str>), +} |