use thiserror::Error;
#[derive(Debug, Error)]
pub enum WorkflowJsError {
#[error("failed to initialize the Workflow JS VM: {0}")]
VmInit(String),
#[error("script error: {0}")]
Script(String),
#[error("workflow run cancelled")]
Cancelled,
#[error("script result is not JSON-encodable: {0}")]
ResultEncoding(String),
#[error("invalid workflow arguments: {0}")]
InvalidArgs(String),
#[error("Workflow VM thread terminated unexpectedly: {0}")]
VmTerminated(String),
}
#[derive(Debug, Clone, Error)]
pub enum DriverError {
#[error("spawn rejected: {0}")]
Rejected(String),
#[error("driver unavailable: {0}")]
Unavailable(String),
}