mirror of
https://github.com/kjuulh/dagger-rs.git
synced 2025-08-06 23:43:26 +02:00
The change here is to make it easier for the consumer to debug the api. Such that they can `match` on individual errors instead of having to parse text. eyre is convenient, but mostly from a consumers perspective
28 lines
824 B
Rust
28 lines
824 B
Rust
use thiserror::Error;
|
|
|
|
#[derive(Error, Debug)]
|
|
pub enum ConnectError {
|
|
#[error("failed to connect to dagger engine")]
|
|
FailedToConnect(#[source] eyre::Error),
|
|
}
|
|
|
|
#[derive(Error, Debug)]
|
|
pub enum DaggerError {
|
|
#[error("failed to build dagger internal graph")]
|
|
Build(#[source] eyre::Error),
|
|
#[error("failed to parse input type")]
|
|
Serialize(#[source] eyre::Error),
|
|
#[error("failed to query dagger engine: {0}")]
|
|
Query(#[source] dagger_core::graphql_client::GraphQLError),
|
|
#[error("failed to unpack response")]
|
|
Unpack(#[source] DaggerUnpackError),
|
|
}
|
|
|
|
#[derive(Error, Debug)]
|
|
pub enum DaggerUnpackError {
|
|
#[error("Too many nested objects inside graphql response")]
|
|
TooManyNestedObjects,
|
|
#[error("failed to deserialize response")]
|
|
Deserialize(#[source] serde_json::Error),
|
|
}
|