ave_common/
error.rs

1//! Error types for Ave Common
2//!
3//! Simplified error types without heavy dependencies
4
5use thiserror::Error;
6
7#[cfg(feature = "openapi")]
8use utoipa::ToSchema;
9
10#[derive(Error, Debug, Clone)]
11#[cfg_attr(feature = "openapi", derive(ToSchema))]
12pub enum Error {
13    /// Bridge error
14    #[error("Bridge error: {0}")]
15    Bridge(String),
16
17    /// Serialization/Deserialization error
18    #[error("Serde error: {0}")]
19    Serde(String),
20
21    /// Invalid identifier error
22    #[error("Invalid identifier: {0}")]
23    InvalidIdentifier(String),
24
25    /// Generic error
26    #[error("{0}")]
27    Generic(String),
28}
29
30impl From<serde_json::Error> for Error {
31    fn from(err: serde_json::Error) -> Self {
32        Error::Serde(err.to_string())
33    }
34}