pub enum WorkflowJsError {
VmInit(String),
Script(String),
Cancelled,
ResultEncoding(String),
InvalidArgs(String),
VmTerminated(String),
}Expand description
Errors surfaced by crate::WorkflowVm::run_script.
Script-visible failures (thrown JS exceptions, rejected promises, host
function errors that were not caught inside the script) all collapse into
WorkflowJsError::Script with the exception message and stack. The
remaining variants describe runtime-level failures that never reached the
script.
Variants§
VmInit(String)
The QuickJS runtime or context could not be created.
Script(String)
The script threw (or a promise rejected) and nothing caught it. Carries the exception message plus stack when available.
Cancelled
The run was cancelled — either the caller dropped the run future or the cooperative cancel signal fired mid-script.
ResultEncoding(String)
The script completed but its return value could not be encoded as JSON (e.g. it returned a function or a cyclic object).
InvalidArgs(String)
The invocation arguments could not be injected into the VM.
VmTerminated(String)
The dedicated VM thread exited without reporting a result (panic or spawn failure). Outstanding driver tasks are cancelled when this is observed.
Trait Implementations§
Source§impl Debug for WorkflowJsError
impl Debug for WorkflowJsError
Source§impl Display for WorkflowJsError
impl Display for WorkflowJsError
Source§impl Error for WorkflowJsError
impl Error for WorkflowJsError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()