use thiserror::Error;
pub type Result<T> = std::result::Result<T, GraphError>;
#[derive(Error, Debug)]
pub enum GraphError {
#[error("Node not found: {0}")]
NodeNotFound(String),
#[error("Edge not found: from {from} to {to}")]
EdgeNotFound { from: String, to: String },
#[error("Cycle detected in graph involving node: {0}")]
CycleDetected(String),
#[error("Invalid graph structure: {0}")]
InvalidGraph(String),
#[error("Port validation error: {0}")]
PortError(String),
#[error("Execution error: {0}")]
ExecutionError(String),
#[error("Data type mismatch: expected {expected}, got {actual}")]
TypeMismatch { expected: String, actual: String },
#[error("Missing required input for node {node}: {port}")]
MissingInput { node: String, port: String },
#[error("{0}")]
Other(String),
}