Struct Error
#[repr(transparent)]
pub struct Error { /* private fields */ }
Implementations
impl Error
fn message(&self) -> JsStringThe message property is a human-readable description of the error.
impl Error
fn set_name(&self, name: &str)
impl Error
fn set_stack_trace_limit(value: &JsValue)Set
Error.stackTraceLimitto control the number of stack frames collected by a stack trace.This is a non-standard V8/Node.js API.
impl Error
fn new(message: &str) -> ErrorThe 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.
impl Error
fn new_with_options(message: &str, options: &Object) -> ErrorCreates a new
Errorwith the given message and an untyped options object whosecauseproperty indicates the original cause of the error.New code should prefer
Error::new_with_error_options, which takes a typedErrorOptionsdictionary.
impl Error
fn cause(&self) -> JsValueThe cause property is the underlying cause of the error. Usually this is used to add context to re-thrown errors.
impl Error
fn set_message(&self, message: &str)
impl Error
fn to_string(&self) -> JsStringThe
toString()method returns a string representing the specified Error object
impl Error
fn set_cause(&self, cause: &JsValue)
impl Error
fn name(&self) -> JsStringThe name property represents a name for the type of error. The initial value is "Error".
impl Error
fn stack_trace_limit() -> JsValueThe
Error.stackTraceLimitproperty controls the number of stack frames collected by a stack trace.This is a non-standard V8/Node.js API.
impl Error
fn new_with_error_options(message: &str, options: &ErrorOptions) -> ErrorCreates a new
Errorwith the given message and a typedErrorOptionsdictionary whosecauseproperty indicates the original cause of the error.
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) -> boolfn unchecked_from_js(val: JsValue) -> Selffn 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()