dtolnay / thiserror

derive(Error) for struct and enum error types

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can this work with a Vec<Error>

Bajix opened this issue · comments

As far as I can tell there's no way to make this work:

use thiserror::Error;
use async_graphql::ServerError;

#[derive(Error, Debug)]
pub enum DataError {
  #[error("{0:?}")]
  GraphQLError(#[from] Vec<ServerError>)
}

That's right, this crate is specifically for single errors. For working with multiple simultaneous errors, you would want to find another approach. I don't have crate recommendations.