1use 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 #[error("Bridge error: {0}")]
15 Bridge(String),
16
17 #[error("Serde error: {0}")]
19 Serde(String),
20
21 #[error("Invalid identifier: {0}")]
23 InvalidIdentifier(String),
24
25 #[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}