Skip to main content

WebUIError

Enum WebUIError 

Source
pub enum WebUIError {
    ComponentAssetPublication {
        context: String,
        source: Box<dyn Error + Send + Sync>,
    },
    Io {
        context: String,
        source: Error,
    },
    ComponentRegistration {
        context: String,
        source: ParserError,
    },
    ComponentDiscovery(String),
    Parse {
        context: String,
        source: ParserError,
    },
    Protocol(ProtocolError),
    Serialization(String),
    Rendering(HandlerError),
    InvalidBuildOptions(String),
    ComponentAssets(Box<Diagnostic>),
    Projection(Box<Diagnostic>),
}
Expand description

Errors that can occur during WebUI build, render, or inspection operations.

Variants§

§

ComponentAssetPublication

Transactional component asset publication or cleanup failure.

Fields

§context: String

The failed publication operation.

§source: Box<dyn Error + Send + Sync>

The underlying filesystem, serialization, or finalization error.

§

Io

I/O error (file read/write failures).

Fields

§context: String

What operation failed.

§source: Error

The underlying I/O error.

§

ComponentRegistration

Component registration failure while reading, transforming, or inserting an authored component source.

context names what was being registered (an app directory or a discovered source). The underlying ParserError is preserved as a structured #[source] rather than being flattened to a string, so a build-time authoring mistake surfaced by a component-source transform reaches the CLI as ParserError::Template with its stable diagnostic code, source location, snippet, and help intact — the same structured path already used by WebUIError::Parse.

Fields

§context: String

What was being registered (path or discovered source).

§source: ParserError

The underlying registration error, structurally preserved.

§

ComponentDiscovery(String)

Component discovery failure (npm packages or local paths).

§

Parse

HTML/CSS parsing failure with context about which file failed.

Fields

§context: String

What was being parsed.

§source: ParserError

The underlying parse error.

§

Protocol(ProtocolError)

Protocol serialization or deserialization failure.

§

Serialization(String)

JSON serialization failure.

§

Rendering(HandlerError)

Handler rendering error.

§

InvalidBuildOptions(String)

Invalid build-option configuration.

§

ComponentAssets(Box<Diagnostic>)

Static component asset graph failure with a structured diagnostic.

§

Projection(Box<Diagnostic>)

Bundler-neutral state projection manifest failure: malformed schema, stale/missing input or output file, build-ID mismatch, conflicting or duplicate fragment ownership, missing scripted-component coverage, or an incompatible plugin. Carries a structured, color-free [Diagnostic] with a stable PROJ-* code (see webui::projection::codes).

The diagnostic is boxed so this cold error path does not enlarge Result<_, WebUIError> on the common success path.

Implementations§

Source§

impl WebUIError

Source

pub fn chain_message(&self) -> String

The full, single-line message including the source chain, e.g. Failed to parse index.html: Directive error: Invalid for each: x.

Each error layer’s std::fmt::Display describes only its own level (the #[source] chain carries the rest), so the CLI and dev server can use anyhow’s {:#} formatting without repetition. Hosts that surface a flat string instead of walking the chain — Node, FFI — use this helper to get the same complete message.

Trait Implementations§

Source§

impl Debug for WebUIError

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Display for WebUIError

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Error for WebUIError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<HandlerError> for WebUIError

Source§

fn from(source: HandlerError) -> Self

Converts to this type from the input type.
Source§

impl From<ProtocolError> for WebUIError

Source§

fn from(source: ProtocolError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.