Struct v8::Exception

source ·
pub struct Exception;
Expand description

Create new error objects by calling the corresponding error object constructor with the message.

Implementations§

source§

impl Exception

source

pub fn error<'s>( scope: &mut HandleScope<'s>, message: Local<'_, String> ) -> Local<'s, Value>

source

pub fn range_error<'s>( scope: &mut HandleScope<'s>, message: Local<'_, String> ) -> Local<'s, Value>

source

pub fn reference_error<'s>( scope: &mut HandleScope<'s>, message: Local<'_, String> ) -> Local<'s, Value>

source

pub fn syntax_error<'s>( scope: &mut HandleScope<'s>, message: Local<'_, String> ) -> Local<'s, Value>

source

pub fn type_error<'s>( scope: &mut HandleScope<'s>, message: Local<'_, String> ) -> Local<'s, Value>

source

pub fn create_message<'s>( scope: &mut HandleScope<'s>, exception: Local<'_, Value> ) -> Local<'s, Message>

Creates an error message for the given exception. Will try to reconstruct the original stack trace from the exception value, or capture the current stack trace if not available.

source

pub fn get_stack_trace<'s>( scope: &mut HandleScope<'s>, exception: Local<'_, Value> ) -> Option<Local<'s, StackTrace>>

Returns the original stack trace that was captured at the creation time of a given exception, or an empty handle if not available.

Trait Implementations§

source§

impl Debug for Exception

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.