1use thiserror::Error;
4
5#[derive(Error, Debug)]
7pub enum PluginError {
8 #[error("Plugin not found: {0}")]
10 NotFound(String),
11
12 #[error("Plugin load failed: {0}")]
14 LoadFailed(String),
15
16 #[error("Plugin version mismatch: expected {expected}, got {actual}")]
18 VersionMismatch {
19 expected: String,
21 actual: String,
23 },
24
25 #[error("Plugin initialization failed: {0}")]
27 InitFailed(String),
28
29 #[error("Codec not provided by plugin: {0}")]
31 CodecNotAvailable(String),
32
33 #[error("Plugin API version incompatible: {0}")]
35 ApiIncompatible(String),
36
37 #[error("Dynamic loading not enabled (compile with 'dynamic-loading' feature)")]
39 DynamicLoadingDisabled,
40
41 #[error("I/O error: {0}")]
43 Io(#[from] std::io::Error),
44
45 #[error("Codec error: {0}")]
47 Codec(#[from] oximedia_codec::CodecError),
48
49 #[error("Invalid manifest: {0}")]
51 InvalidManifest(String),
52
53 #[error("Plugin already registered: {0}")]
55 AlreadyRegistered(String),
56
57 #[error("JSON error: {0}")]
59 Json(#[from] serde_json::Error),
60}
61
62pub type PluginResult<T> = Result<T, PluginError>;