1use thiserror::Error;
4
5pub type Result<T> = std::result::Result<T, PluginError>;
7
8#[derive(Debug, Error)]
10pub enum PluginError {
11 #[error("template not found: {0}")]
13 TemplateNotFound(String),
14
15 #[error("template validation failed: {0}")]
17 TemplateValidationError(String),
18
19 #[error("selector evaluation failed: {selector}, reason: {reason}")]
21 SelectorError { selector: String, reason: String },
22
23 #[error("extraction failed: {0}")]
25 ExtractionError(String),
26
27 #[error("extraction already completed with idempotency key: {0}")]
29 IdempotencyDuplicate(String),
30
31 #[error("idempotency store error: {0}")]
33 IdempotencyStoreError(String),
34
35 #[error("template storage error: {0}")]
37 StorageError(String),
38
39 #[error("serialization error: {0}")]
41 SerializationError(#[from] serde_json::Error),
42
43 #[error("io error: {0}")]
45 IoError(#[from] std::io::Error),
46
47 #[error("timeout occurred")]
49 Timeout,
50
51 #[error("invalid transformation: {0}")]
53 InvalidTransformation(String),
54
55 #[error("schema validation failed: {0}")]
57 SchemaValidationError(String),
58
59 #[error("{0}")]
61 Other(String),
62}