21 lines
790 B
Rust
21 lines
790 B
Rust
use thiserror::Error;
|
|
|
|
#[derive(Clone, Debug, PartialEq, Eq, Error)]
|
|
pub enum MappingError {
|
|
#[error("invalid JSONPath: {path}")]
|
|
InvalidJsonPath { path: String },
|
|
#[error("unsupported source root {root} for {context} mapping")]
|
|
UnsupportedSourceRoot { root: String, context: &'static str },
|
|
#[error("unsupported target root {root} for {context} mapping")]
|
|
UnsupportedTargetRoot { root: String, context: &'static str },
|
|
#[error("mixed mapping target contexts are not allowed")]
|
|
MixedTargetContext,
|
|
#[error("missing required value at {path}")]
|
|
MissingRequiredValue { path: String },
|
|
#[error("transform {transform} cannot be applied to {actual}")]
|
|
InvalidTransformInput {
|
|
transform: &'static str,
|
|
actual: &'static str,
|
|
},
|
|
}
|