invokeGuarded

inline fun <T> invokeGuarded(call: FunctionCall<*>, body: () -> T): T

Runs a generated native function body, attributing any error raised inside it to call.

Errors that already carry pipeline semantics, including those bubbling up from a nested function call, propagate untouched; anything else, such as an IllegalArgumentException from a require check, is wrapped so the reader sees which call failed.

Return

the function's output

Parameters

call

the call being executed

body

the generated invocation

Type Parameters

T

the function's output type