#[non_exhaustive]pub enum RenderError {
#[non_exhaustive] MissingModule {
route: String,
},
#[non_exhaustive] Walk {
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:
| Code | Variant | Cause |
|---|---|---|
| RENDER-101 | MissingModule | The config has no module or no slots to render |
| RENDER-102 | Walk | The walk refused the module or its data |
| RENDER-201 | Policy | A policy extension is not a source a page may add |
| RENDER-202 | Nonce | The system random source failed to draw a nonce |
| RENDER-301 | Budget | The walk’s output passed max_output_bytes |
| RENDER-302 | Budget | The walk’s list rows passed max_list_iterations |
| RENDER-303 | Budget | Lists or control flow nested past the walker’s depth |
| RENDER-399 | Fault | The 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]MissingModule
RENDER-101: try_render renders on the server, 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]Walk
RENDER-102: the walk refused the module or the data it was given.
Fields
This variant is marked as non-exhaustive
counts: RenderCountsHow far the walk got.
#[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
cause: PolicyErrorThe 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
cause: NonceErrorThe failed draw.
#[non_exhaustive]Budget
RENDER-301, RENDER-302, RENDER-303: the walk reached one of its budgets, and stopped there instead of running on.
Fields
This variant is marked as non-exhaustive
counts: RenderCountsHow far the walk got before the budget stopped it.
#[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
counts: RenderCountsHow far the walk got, when it was in the walk.
Implementations§
Source§impl RenderError
impl RenderError
Sourcepub fn component_path(&self) -> &[String]
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.
Sourcepub fn counts(&self) -> Option<RenderCounts>
pub fn counts(&self) -> Option<RenderCounts>
How far the walk got, for an error raised during it.
Trait Implementations§
Source§impl Clone for RenderError
impl Clone for RenderError
Source§impl Debug for RenderError
impl Debug for RenderError
Source§impl Display for RenderError
impl Display for RenderError
impl Eq for RenderError
Source§impl Error for RenderError
impl Error for RenderError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()