use thiserror::Error;
pub type Result<T> = std::result::Result<T, ThundError>;
#[derive(Debug, Error)]
pub enum ThundError {
#[error("duplicate {kind} name: {name}")]
DuplicateName {
kind: &'static str,
name: String,
},
#[error("flow {flow} writes to undefined dataset {target}")]
DanglingFlow {
flow: String,
target: String,
},
#[error("pipeline dataflow graph is cyclic")]
Cyclic,
#[error("backend `{backend}` does not support: {what}")]
Unsupported {
backend: &'static str,
what: String,
},
#[error("dsl parse error: {0}")]
Dsl(String),
#[error("sql parse error: {0}")]
Sql(String),
#[error("backend error: {0}")]
Backend(String),
}