Struct Error

#[repr(transparent)]
pub struct Error { /* private fields */ }

Implementations

impl Error

fn message(&self) -> JsString

The message property is a human-readable description of the error.

MDN documentation

impl Error

fn set_name(&self, name: &str)

impl Error

fn set_stack_trace_limit(value: &JsValue)

Set Error.stackTraceLimit to control the number of stack frames collected by a stack trace.

This is a non-standard V8/Node.js API.

V8 documentation

impl Error

fn new(message: &str) -> Error

The Error constructor creates an error object. Instances of Error objects are thrown when runtime errors occur. The Error object can also be used as a base object for user-defined exceptions. See below for standard built-in error types.

MDN documentation

impl Error

fn new_with_options(message: &str, options: &Object) -> Error

Creates a new Error with the given message and an untyped options object whose cause property indicates the original cause of the error.

New code should prefer Error::new_with_error_options, which takes a typed ErrorOptions dictionary.

MDN documentation

impl Error

fn cause(&self) -> JsValue

The cause property is the underlying cause of the error. Usually this is used to add context to re-thrown errors.

MDN documentation

impl Error

fn set_message(&self, message: &str)

impl Error

fn to_string(&self) -> JsString

The toString() method returns a string representing the specified Error object

MDN documentation

impl Error

fn set_cause(&self, cause: &JsValue)

impl Error

fn name(&self) -> JsString

The name property represents a name for the type of error. The initial value is "Error".

MDN documentation

impl Error

fn stack_trace_limit() -> JsValue

The Error.stackTraceLimit property controls the number of stack frames collected by a stack trace.

This is a non-standard V8/Node.js API.

V8 documentation

impl Error

fn new_with_error_options(message: &str, options: &ErrorOptions) -> Error

Creates a new Error with the given message and a typed ErrorOptions dictionary whose cause property indicates the original cause of the error.

MDN documentation

Trait Implementations

impl AsRef<Error> for Error

fn as_ref(&self) -> &Error

impl AsRef<JsValue> for Error

fn as_ref(&self) -> &JsValue

impl AsRef<Object> for Error

fn as_ref(&self) -> &Object

impl Clone for Error

fn clone(&self) -> Self

impl Debug for Error

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

impl Deref for Error

type Target = Object;
fn deref(&self) -> &Object

impl Eq for Error

impl ErasableGeneric for Error

type Repr = JsValue;

impl From<AggregateError> for Error

fn from(obj: AggregateError) -> Error

impl From<CompileError> for Error

fn from(obj: CompileError) -> Error

impl From<EvalError> for Error

fn from(obj: EvalError) -> Error

impl From<JsValue> for Error

fn from(obj: JsValue) -> Self

impl From<LinkError> for Error

fn from(obj: LinkError) -> Error

impl From<RangeError> for Error

fn from(obj: RangeError) -> Error

impl From<ReferenceError> for Error

fn from(obj: ReferenceError) -> Error

impl From<RuntimeError> for Error

fn from(obj: RuntimeError) -> Error

impl From<SyntaxError> for Error

fn from(obj: SyntaxError) -> Error

impl From<TypeError> for Error

fn from(obj: TypeError) -> Error

impl From<UriError> for Error

fn from(obj: UriError) -> Error

impl FromWasmAbi for Error

type Abi = <JsValue as FromWasmAbi>::Abi;
unsafe fn from_abi(js: Self::Abi) -> Self

impl IntoJsGeneric for Error where Error: JsGeneric,

type JsCanon = Error;
fn to_js(self) -> Error

impl IntoWasmAbi for Error

type Abi = <JsValue as IntoWasmAbi>::Abi;
fn into_abi(self) -> Self::Abi

impl JsCast for Error

fn instanceof(val: &JsValue) -> bool
fn unchecked_from_js(val: JsValue) -> Self
fn unchecked_from_js_ref(val: &JsValue) -> &Self

impl LongRefFromWasmAbi for Error

type Abi = <JsValue as LongRefFromWasmAbi>::Abi;
type Anchor = Error;
unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor

impl OptionFromWasmAbi for Error

fn is_none(abi: &Self::Abi) -> bool

impl OptionIntoWasmAbi for Error

fn none() -> Self::Abi

impl PartialEq for Error

fn eq(&self, other: &Self) -> bool

impl Promising for Error

type Resolution = Error;

impl RefFromWasmAbi for Error

type Abi = <JsValue as RefFromWasmAbi>::Abi;
type Anchor = ManuallyDrop<Error>;
unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor

impl StructuralPartialEq for Error

impl UpcastFrom<AggregateError> for Error

impl UpcastFrom<CompileError> for Error

impl UpcastFrom<Error> for Error

impl UpcastFrom<EvalError> for Error

impl UpcastFrom<LinkError> for Error

impl UpcastFrom<RangeError> for Error

impl UpcastFrom<ReferenceError> for Error

impl UpcastFrom<RuntimeError> for Error

impl UpcastFrom<SyntaxError> for Error

impl UpcastFrom<TypeError> for Error

impl UpcastFrom<UriError> for Error

impl WasmDescribe for Error

fn describe()

Auto Trait Implementations

impl Freeze for Error

impl RefUnwindSafe for Error

impl Send for Error

impl Sync for Error

impl Unpin for Error

impl UnsafeUnpin for Error

impl UnwindSafe for Error

Blanket Implementations

impl<P, T> Receiver for Error where P: Deref<Target = T> + ?Sized, T: ?Sized,

impl<S, T> Upcast<T> for Error where T: UpcastFrom<S> + ?Sized, S: ?Sized,

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

impl<T> Borrow<T> for Error where T: ?Sized,

impl<T> BorrowMut<T> for Error where T: ?Sized,

impl<T> CloneToUninit for Error where T: Clone,

impl<T> From<T> for Error

impl<T> JsGeneric for Error where T: ErasableGeneric<Repr = JsValue> + UpcastFrom<T> + Upcast<JsValue> + JsCast + 'static,

impl<T> ReturnWasmAbi for Error where T: IntoWasmAbi,

impl<T> ToOwned for Error where T: Clone,

impl<T> TryFromJsValue for Error where T: JsCast,

impl<T> VectorFromWasmAbi for Error where T: ErasableGeneric<Repr = JsValue> + WasmDescribe,

impl<T> VectorIntoWasmAbi for Error where T: ErasableGeneric<Repr = JsValue> + WasmDescribe,

impl<T> VectorRefIntoWasmAbi for Error where &'a T: for<'a> Into<JsValue>,

impl<T, U> Into<U> for Error where U: From<T>,

impl<T, U> TryFrom<U> for Error where U: Into<T>,

impl<T, U> TryInto<U> for Error where U: TryFrom<T>,