anda_db_schema/
error.rs

1//! Error types for schema module
2use thiserror::Error;
3
4/// A type alias for a boxed error that is thread-safe and sendable across threads.
5/// This is commonly used as a return type for functions that can return various error types.
6pub type BoxError = Box<dyn std::error::Error + Send + Sync>;
7
8/// Schema related errors
9#[derive(Error, Debug)]
10pub enum SchemaError {
11    #[error("Invalid schema: {0}")]
12    Schema(String),
13    /// Invalid field type error
14    #[error("Invalid field type: {0}")]
15    FieldType(String),
16
17    /// Invalid field value error
18    #[error("Invalid field value: {0}")]
19    FieldValue(String),
20
21    /// Invalid field name error
22    #[error("Invalid field name: {0}")]
23    FieldName(String),
24
25    /// Field validation error
26    #[error("Field validation failed: {0}")]
27    Validation(String),
28
29    /// Serialization error
30    #[error("Serialization error: {0}")]
31    Serialization(String),
32}