proteus/actions/getter/namespace/
errors.rs

1use std::num::ParseIntError;
2use thiserror::Error;
3
4/// This type represents all possible errors that an occur while parsing transformation syntax to generate a [Namespace](enum.Namespace.html) to be used in [Getter](../struct.Getter.html).
5#[derive(Error, Debug)]
6pub enum Error {
7    #[error("Invalid '.' notation for namespace: {}. {}", ns, err)]
8    InvalidDotNotation { err: String, ns: String },
9
10    #[error(transparent)]
11    InvalidNamespaceArrayIndex(#[from] ParseIntError),
12
13    #[error("Missing end bracket ']' in array index for namespace: {0}")]
14    MissingArrayIndexBracket(String),
15
16    #[error("Invalid Explicit Key Syntax for namespace {0}. Explicit Key Syntax must start with '[\"' and end with '\"]' with any enclosed '\"' escaped.")]
17    InvalidExplicitKeySyntax(String),
18}