byo_graphql/
error.rs

1use {
2    serde::Deserialize,
3    thiserror::Error,
4};
5
6#[derive(Debug, Error)]
7pub enum ByoError {
8    #[error("server returned an error: {0:?}")]
9    Graphql(Vec<GraphqlError>),
10    #[error("no data in response")]
11    NoData,
12    #[error("requesting error")]
13    RequestError(#[from] reqwest::Error),
14}
15
16pub type ByoResult<T> = Result<T, ByoError>;
17
18#[derive(Debug, Deserialize)]
19pub struct GraphqlError {
20    pub path: Option<Vec<String>>,
21    pub message: Option<String>,
22}