Skip to main content

throw_condition

Function throw_condition 

Source
pub async fn throw_condition<T: Send>(
    caller: &mut Caller<'_, T>,
    code: &str,
    message: &str,
    detail: &EvalValue,
) -> Error
Expand description

Throws a $nomi_error carrying code (upper-cased, as handler-case compares it), message and the structured detail, so the calling script’s handler-case can catch it and read the detail with error-detail. Return the result from the host fn: return Err(throw_condition(&mut caller, code, message, &detail).await). Any failure while building the condition is returned in its place.