Skip to main content

DesktopError

Enum DesktopError 

Source
pub enum DesktopError {
Show 19 variants WebsiteData(WebsiteDataError), PackagedResourcesNotFound, Backend { source: Box<dyn Error + Send + Sync>, }, Io { context: String, source: Error, }, Render(HandlerError), Protocol(ProtocolError), StateJson { path: PathBuf, source: Error, }, Serialization { context: String, source: Error, }, Token { context: String, source: TokenError, }, InvalidAssetPath { path: String, }, InvalidRoutePattern { pattern: String, help: String, }, RouteProvider { path: String, message: String, }, AssetTooLarge { path: PathBuf, size: u64, max_bytes: u64, }, BundleAssetCollision { path: String, }, OutputPathOverlap { output: PathBuf, input: PathBuf, input_label: &'static str, }, PackageValidation { message: String, help: &'static str, }, ManifestSerialization(Error), ManifestDeserialization { path: PathBuf, source: Error, }, UnsupportedRuntime { message: String, help: String, },
}
Expand description

Errors produced by the runtime-neutral WebUI desktop layer.

Variants§

§

WebsiteData(WebsiteDataError)

An explicit native website-data persistence request failed.

§

PackagedResourcesNotFound

No desktop bundle could be found beside the running executable.

§

Backend

A native or custom desktop backend could not complete an operation.

Fields

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

Underlying backend failure.

§

Io

I/O failure while reading or writing desktop runtime data.

Fields

§context: String

Operation that failed.

§source: Error

Underlying I/O error.

§

Render(HandlerError)

Handler rendering failed.

§

Protocol(ProtocolError)

Protocol serialization or deserialization failed.

§

StateJson

State JSON could not be parsed.

Fields

§path: PathBuf

State file path.

§source: Error

Underlying JSON parser error.

§

Serialization

JSON serialization failed.

Fields

§context: String

Operation that failed.

§source: Error

Underlying JSON error.

§

Token

Design token loading or resolution failed.

Fields

§context: String

Operation that failed.

§source: TokenError

Underlying token error.

§

InvalidAssetPath

A custom-protocol asset path was unsafe.

Fields

§path: String

Rejected request path.

§

InvalidRoutePattern

A Rust route provider pattern is invalid.

Fields

§pattern: String

Rejected route pattern.

§help: String

Actionable fix.

§

RouteProvider

A Rust route provider failed.

Fields

§path: String

Request path.

§message: String

Provider error message.

§

AssetTooLarge

An asset exceeds the configured in-memory response cap.

Fields

§path: PathBuf

Asset path.

§size: u64

Actual size in bytes.

§max_bytes: u64

Configured maximum size.

§

BundleAssetCollision

Two bundle inputs resolve to the same output asset path.

Fields

§path: String

Colliding bundle-relative path.

§

OutputPathOverlap

A bundle or package output path overlaps an input path.

Fields

§output: PathBuf

Output path that would be cleaned or written.

§input: PathBuf

Input path that must be preserved.

§input_label: &'static str

Human-readable input label.

§

PackageValidation

An already-compiled host package input is invalid or unsafe.

Fields

§message: String

Specific rejected input.

§help: &'static str

Actionable correction.

§

ManifestSerialization(Error)

Bundle manifest serialization failed.

§

ManifestDeserialization

Bundle manifest deserialization failed.

Fields

§path: PathBuf

Manifest path.

§source: Error

Underlying parser error.

§

UnsupportedRuntime

Platform runtime does not support a required desktop capability.

Fields

§message: String

What capability is missing.

§help: String

Actionable fix.

Implementations§

Source§

impl DesktopError

Source

pub fn hint(&self) -> Option<&str>

Return an actionable hint for errors that have a clear next step.

Source

pub fn chain_message(&self) -> String

Return a flattened source-chain message for hosts that do not walk std::error::Error::source.

Trait Implementations§

Source§

impl Debug for DesktopError

Source§

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

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

impl Display for DesktopError

Source§

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

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

impl Error for DesktopError

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 DesktopError

Source§

fn from(source: HandlerError) -> Self

Converts to this type from the input type.
Source§

impl From<ProtocolError> for DesktopError

Source§

fn from(source: ProtocolError) -> Self

Converts to this type from the input type.
Source§

impl From<WebsiteDataError> for DesktopError

Source§

fn from(source: WebsiteDataError) -> 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> 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.