dpp_plugin_traits/
error.rs1use serde::{Deserialize, Serialize};
4use thiserror::Error;
5
6#[derive(Debug, Clone, Serialize, Deserialize)]
8#[serde(rename_all = "camelCase")]
9pub struct PluginFieldError {
10 pub field: String,
12 pub code: String,
14 pub message: String,
16}
17
18#[derive(Debug, Clone, Error, Serialize, Deserialize)]
19pub enum PluginError {
20 #[error("invalid input: {0}")]
21 InvalidInput(String),
22 #[error("validation errors: {0:?}")]
23 ValidationErrors(Vec<PluginFieldError>),
24 #[error("calculation failed: {0}")]
25 Calculation(String),
26 #[error("sector not supported by this plugin: {0}")]
27 UnsupportedSector(String),
28 #[error("schema version not supported: {0}")]
29 UnsupportedSchemaVersion(String),
30 #[error("capability not available: {0}")]
31 CapabilityNotAvailable(String),
32 #[error("internal plugin error: {0}")]
33 Internal(String),
34}