cdevents_sdk/
error.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use thiserror::Error;

// type Result<T> = std::result::Result<T, Error>;

#[derive(Error, Debug)]
pub enum Error {
    #[error("Empty data in cloudevent")]
    DataNotFoundInCloudEvent,
    #[error(transparent)]
    UriParseError( #[from] fluent_uri::error::ParseError<String>),
    #[error(transparent)]
    SerdeJsonError( #[from] serde_json::Error),
    #[error("unknown error")]
    Unknown,
    #[error("{0} should be non-empty")]
    EmptyString(&'static str)
}