[][src]Trait ducc::RuntimeError

pub trait RuntimeError: Debug {
    fn code(&self) -> RuntimeErrorCode { ... }
fn name(&self) -> String { ... }
fn message(&self) -> Option<String> { ... } }

A Rust error that can be transformed into a JavaScript error.

Provided methods

fn code(&self) -> RuntimeErrorCode

The prototypical JavaScript error code.

By default, this method returns RuntimeErrorCode::Error.

fn name(&self) -> String

The name of the error corresponding to the JavaScript error's name property.

By default, this method returns the string name corresponding to this object's code() return value.

fn message(&self) -> Option<String>

An optional message that is set on the JavaScript error's message property. This is automatically appended to the parent Error's context field.

By default, this method returns None.

Loading content...

Implementations

impl dyn RuntimeError[src]

pub fn downcast_ref<T: RuntimeError + 'static>(&self) -> Option<&T>[src]

Attempts to downcast this failure to a concrete type by reference.

If the underlying error is not of type T, this will return None.

Implementations on Foreign Types

impl RuntimeError for ()[src]

impl RuntimeError for String[src]

impl<'a> RuntimeError for &'a str[src]

Loading content...

Implementors

Loading content...