Skip to main content

RenderError

Enum RenderError 

Source
#[non_exhaustive]
pub enum RenderError {
Show 13 variants
#[non_exhaustive]
StaticRoute { route: String, message: String, },
#[non_exhaustive]
Manifest { route: String, message: String, },
#[non_exhaustive]
RouteMode { route: String, },
#[non_exhaustive]
Unfinalized { route: String, },
#[non_exhaustive]
Props { cause: PropsError, },
#[non_exhaustive]
Binding { route: String, errors: Vec<PropsError>, },
#[non_exhaustive]
MissingModule { route: String, },
#[non_exhaustive]
Walk { route: String, component_path: Vec<String>, counts: RenderCounts, cause: IrError, },
#[non_exhaustive]
IslandState { route: String, component_path: Vec<String>, counts: RenderCounts, cause: IrError, },
#[non_exhaustive]
Policy { route: String, cause: PolicyError, },
#[non_exhaustive]
Nonce { route: String, cause: NonceError, },
#[non_exhaustive]
Budget { route: String, component_path: Vec<String>, counts: RenderCounts, cause: IrError, },
#[non_exhaustive]
Fault { route: String, component_path: Vec<String>, counts: RenderCounts, message: String, },
}
Expand description

Why a page was not rendered. Nothing reaches the browser unless the handler sends it: answer with the application’s own error page.

Every error has a stable code, the route it was rendering, and the component_path where it stopped (empty when the failure is not inside a component). The codes, by family:

CodeVariantCause
RENDER-101MissingModuleThe config has no module or no slots to render
RENDER-104ManifestInvalid manifest or referenced integrity
RENDER-105StaticRouteA static SSR route requires JavaScript for islands, configuration or preloads
RENDER-103RouteModeA shell route is absent or not Browser
RENDER-406UnfinalizedRequired startup finalization is incomplete
RENDER-102WalkThe walk refused the module or its data
RENDER-503WalkA keyed list row has no usable identity, repeats another row’s key, or has no single root to carry it (FORMA-181)
RENDER-201PolicyA policy extension is not a source a page may add
RENDER-202NonceThe system random source failed to draw a nonce
RENDER-301BudgetThe complete escaped response passed max_output_bytes
RENDER-302BudgetThe walk’s list rows passed max_list_iterations
RENDER-303BudgetLists or control flow nested past the walker’s depth
RENDER-501IslandStateDeclared island input mapping or value is invalid
RENDER-502IslandStateEscaped island state exceeds one MiB
RENDER-399FaultThe render panicked; a defect, not an input

A code, once published, keeps its meaning; new causes get new codes.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

#[non_exhaustive]
StaticRoute

RENDER-105: a static SSR route cannot execute or preload JavaScript.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§route: String

The requested route.

§message: String

The incompatible island, configuration or preload contract.

§

#[non_exhaustive]
Manifest

RENDER-104: manifest or referenced resource integrity is invalid.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§route: String

The requested route.

§message: String

Manifest validation failure or the resource whose integrity is unavailable.

§

#[non_exhaustive]
RouteMode

RENDER-103: a browser shell requires an explicitly declared browser route.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§route: String

The requested route.

§

#[non_exhaustive]
Unfinalized

RENDER-406: every SSR handler must bind and the registry must finalize first.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§route: String

The bound route.

§

#[non_exhaustive]
Props

RENDER-401..404: a handler value violates its declared contract.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§cause: PropsError

Checked value error, including its declared property path and sources.

§

#[non_exhaustive]
Binding

RENDER-405: a development reload no longer matches the bound handler.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§route: String

Bound route.

§errors: Vec<PropsError>

Binding refusals for the changed module. No partial HTML is returned.

§

#[non_exhaustive]
MissingModule

RENDER-101: Server rendering, and the config carries no module or no slots for it. A browser-rendered route is served by render_browser_shell, by declaration.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§route: String

The route being rendered.

§

#[non_exhaustive]
Walk

RENDER-102: the walk refused the module or the data it was given.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§route: String

The route being rendered.

§component_path: Vec<String>

The islands open where the walk stopped, outermost first.

§counts: RenderCounts

How far the walk got.

§cause: IrError

The walker’s error.

§

#[non_exhaustive]
IslandState

RENDER-501 or RENDER-502: no partial state or page is returned.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§route: String

Route whose island state was refused.

§component_path: Vec<String>

Open island registration names, outermost first.

§counts: RenderCounts

Body walk work completed before refusal.

§cause: IrError

The invalid field path or fixed state-byte ceiling.

§

#[non_exhaustive]
Policy

RENDER-201: a policy extension was refused; there is no page to send without its policy.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§route: String

The route being rendered.

§cause: PolicyError

The refused extension.

§

#[non_exhaustive]
Nonce

RENDER-202: no nonce could be drawn, so no policy could bless the page.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§route: String

The route being rendered.

§cause: NonceError

The failed draw.

§

#[non_exhaustive]
Budget

RENDER-301, RENDER-302, RENDER-303: the complete response exceeded its output-byte limit, or the walk reached a list/depth budget.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§route: String

The route being rendered.

§component_path: Vec<String>

The islands open where the walk stopped, outermost first.

§counts: RenderCounts

Body-only walk work, including when complete response assembly refuses.

§cause: IrError

The output, list, or depth budget that refused the response.

§

#[non_exhaustive]
Fault

RENDER-399: the render panicked and the panic was caught. The process and every other request carry on, while the application unwinds on panic; under panic = "abort" the process ends.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§route: String

The route being rendered.

§component_path: Vec<String>

The islands open where the walk panicked, when it was in the walk.

§counts: RenderCounts

How far the walk got, when it was in the walk.

§message: String

The panic’s message.

Implementations§

Source§

impl RenderError

Source

pub fn code(&self) -> &'static str

The stable code, such as RENDER-301.

Source

pub fn route(&self) -> &str

The route pattern the render was for.

Source

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

The declared property path of a checked-value refusal.

Source

pub fn component_path(&self) -> &[String]

The component names of the islands open where the render stopped, outermost first; empty when it stopped outside every island or before the walk. A component the compiler inlined into its parent has no name until FMIR v3’s source positions.

Source

pub fn counts(&self) -> Option<RenderCounts>

How far the walk got, for an error raised during it.

Trait Implementations§

Source§

impl Clone for RenderError

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RenderError

Source§

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

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

impl Display for RenderError

Source§

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

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

impl Eq for RenderError

Source§

impl Error for RenderError

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 PartialEq for RenderError

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RenderError

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more