Skip to main content

sova_graphql/
error.rs

1//! GraphQL client errors.
2
3use thiserror::Error;
4
5#[derive(Debug, Error)]
6pub enum GraphqlError {
7    #[error("graphql transport: {0}")]
8    Transport(String),
9    #[error("graphql http {status}: {body}")]
10    Http { status: u16, body: String },
11    #[error("graphql errors: {0}")]
12    Graphql(String),
13    #[error("graphql decode: {0}")]
14    Decode(String),
15    #[error("graphql plugin not installed")]
16    NotInstalled,
17}
18
19impl From<GraphqlError> for sova_core::Error {
20    fn from(value: GraphqlError) -> Self {
21        sova_core::Error::Internal(value.to_string())
22    }
23}