pub enum JsError {
Type(String),
Range(String),
Error(String),
Fields(Box<ErrorFields>),
}Expand description
An error of a chosen JS class: what Result<T, JsError> throws, and
what a Later task’s Err(JsError) rejects with (any other error
type is an Error with its message). JsError::with_code and
JsError::with give it properties, as Node’s errors have
(error.code === "ENOENT"; TS: Error & { code?: string }).
Variants§
Type(String)
A TypeError: the call was not allowed or its value is wrong.
Range(String)
A RangeError: a value past a limit.
Error(String)
An Error.
Fields(Box<ErrorFields>)
One of those with properties.
Implementations§
Trait Implementations§
impl Eq for JsError
Source§impl From<Error> for JsError
An I/O error as Node reports it: Error with the message and the
code of its kind or OS error (ENOENT, EACCES, …; none when it
has no name).
impl From<Error> for JsError
An I/O error as Node reports it: Error with the message and the
code of its kind or OS error (ENOENT, EACCES, …; none when it
has no name).
Source§impl IntoThrown for JsError
impl IntoThrown for JsError
Source§fn into_thrown(self) -> Thrown
fn into_thrown(self) -> Thrown
The exception.
impl StructuralPartialEq for JsError
Auto Trait Implementations§
impl Freeze for JsError
impl RefUnwindSafe for JsError
impl Send for JsError
impl Sync for JsError
impl Unpin for JsError
impl UnsafeUnpin for JsError
impl UnwindSafe for JsError
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