Struct quickjs_wasm_rs::Exception
source · pub struct Exception { /* private fields */ }
Expand description
Exception
represents a JavaScript exception that occurs within the QuickJS context.
This struct provides a convenient way to capture and handle JavaScript exceptions that may be thrown during the execution of JavaScript code. It includes the error message and an optional stack trace to help with debugging and error reporting.
§Example
// Assuming you have a `JSContextRef` where an exception has been thrown.
let exception = Exception::new(context)?;
let err = Err(exception.into_error());
Implementations§
source§impl Exception
impl Exception
pub fn from(exception_obj: JSValueRef<'_>) -> Result<Self>
pub fn into_error(self) -> Error
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Exception
impl RefUnwindSafe for Exception
impl Send for Exception
impl Sync for Exception
impl Unpin for Exception
impl UnwindSafe for Exception
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more