Skip to main content

cast_core/
error.rs

1//! Cast-specific errors. Converted to `anvil::Error` at the HTTP layer.
2
3use thiserror::Error;
4
5pub type Result<T, E = Error> = std::result::Result<T, E>;
6
7#[derive(Debug, Error)]
8pub enum Error {
9    #[error("sqlx error: {0}")]
10    Sqlx(#[from] sqlx::Error),
11
12    #[error("record not found")]
13    NotFound,
14
15    #[error("schema error: {0}")]
16    Schema(String),
17
18    #[error("migration error: {0}")]
19    Migration(String),
20
21    #[error("relation error: {0}")]
22    Relation(String),
23
24    #[error("serialization error: {0}")]
25    Serialization(String),
26
27    #[error("{0}")]
28    Internal(String),
29}