pub struct JsError {
pub message: String,
pub cause: Option<Box<JsError>>,
pub source_line: Option<String>,
pub script_resource_name: Option<String>,
pub line_number: Option<i64>,
pub start_column: Option<i64>,
pub end_column: Option<i64>,
pub frames: Vec<JsStackFrame>,
pub stack: Option<String>,
}
Expand description
A JsError
represents an exception coming from V8, with stack frames and
line numbers. The deno_cli crate defines another JsError
type, which wraps
the one defined here, that adds source map support and colorful formatting.
Fields
message: String
cause: Option<Box<JsError>>
source_line: Option<String>
script_resource_name: Option<String>
line_number: Option<i64>
start_column: Option<i64>
end_column: Option<i64>
frames: Vec<JsStackFrame>
stack: Option<String>
Implementations
sourceimpl JsError
impl JsError
pub fn from_v8_exception(
scope: &mut HandleScope<'_>,
exception: Local<'_, Value>
) -> Self
Trait Implementations
sourceimpl Error for JsError
impl Error for JsError
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
🔬 This is a nightly-only experimental API. (
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
👎 Deprecated since 1.42.0:
use the Display impl or to_string()
impl StructuralPartialEq for JsError
Auto Trait Implementations
impl RefUnwindSafe for JsError
impl Send for JsError
impl Sync for JsError
impl Unpin for JsError
impl UnwindSafe for JsError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more