Skip to main content

guard

Function guard 

Source
pub fn guard<T>(f: impl FnOnce() -> Result<T, PluginError>) -> PluginResult<T>
Expand description

Wraps a closure in catch_unwind and maps a panic to a PluginError.

Macro-generated thunks call this so plug-in panics surface as errors instead of unwinding through the FFI.