openzeppelin_relayer/config/
error.rs

1//! Error types for configuration system.
2//!
3//! This module defines all possible error types used in the configuration system.
4
5use thiserror::Error;
6
7#[derive(Error, Debug)]
8pub enum ConfigFileError {
9    #[error("Invalid ID length: {0}")]
10    InvalidIdLength(String),
11    #[error("Invalid ID format: {0}")]
12    InvalidIdFormat(String),
13    #[error("Missing required field: {0}")]
14    MissingField(String),
15    #[error("IO error: {0}")]
16    IoError(#[from] std::io::Error),
17    #[error("JSON error: {0}")]
18    JsonError(#[from] serde_json::Error),
19    #[error("Duplicate id error: {0}")]
20    DuplicateId(String),
21    #[error("Invalid network type: {0}")]
22    InvalidNetworkType(String),
23    #[error("Invalid network name for {network_type}: {name}")]
24    InvalidNetwork { network_type: String, name: String },
25    #[error("Invalid policy: {0}")]
26    InvalidPolicy(String),
27    #[error("Internal error: {0}")]
28    InternalError(String),
29    #[error("Missing env var: {0}")]
30    MissingEnvVar(String),
31    #[error("Invalid format: {0}")]
32    InvalidFormat(String),
33    #[error("File not found: {0}")]
34    FileNotFound(String),
35    #[error("Invalid reference: {0}")]
36    InvalidReference(String),
37    #[error("File read error: {0}")]
38    FileRead(String),
39    #[error("Test Signer error: {0}")]
40    TestSigner(String),
41    #[error("Incompatible inheritance type: {0}")]
42    IncompatibleInheritanceType(String),
43    #[error("Circular inheritance detected: {0}")]
44    CircularInheritance(String),
45    #[error("Maximum inheritance depth exceeded: {0}")]
46    MaxInheritanceDepthExceeded(String),
47    #[error("Invalid operation: {0}")]
48    InvalidOperation(String),
49}