pub trait ThrowResultExt<'js, T> {
    // Required method
    fn throw(self, ctx: &Ctx<'js>) -> Result<T, Error>;
}
Expand description

Extension trait to easily turn results with CaughtError into results with Error

Calling throw on a CaughtError will set the current error to the one contained in CaughtError if such a value exists and then turn CaughtError into Error.

Required Methods§

source

fn throw(self, ctx: &Ctx<'js>) -> Result<T, Error>

Implementations on Foreign Types§

source§

impl<'js, T> ThrowResultExt<'js, T> for Result<T, CaughtError<'js>>

source§

fn throw(self, ctx: &Ctx<'js>) -> Result<T, Error>

Implementors§