evento_store/
error.rs

1#[derive(Debug, thiserror::Error)]
2pub enum StoreError {
3    #[error("unexpected original version while saving event")]
4    UnexpectedOriginalVersion,
5
6    #[error("metadata must be an object")]
7    MetadataInvalidObjectType,
8
9    #[error("unexpected empty events when trying to write single event")]
10    EmptyWriteEvent,
11
12    #[cfg(feature = "pg")]
13    #[error("sqlx `{0}`")]
14    Sqlx(#[from] sqlx::Error),
15
16    #[error("serde_json `{0}`")]
17    SerdeJson(#[from] serde_json::Error),
18
19    #[error("sdt::num `{0}`")]
20    TryFromInt(#[from] std::num::TryFromIntError),
21
22    #[error("evento_query`{0}`")]
23    Query(#[from] evento_query::QueryError),
24
25    #[error("{0}`")]
26    Any(#[from] anyhow::Error),
27}
28
29pub type Result<T> = std::result::Result<T, StoreError>;