Error Handling
FlowError unifies not-found, loader failures, and render errors into consistent error pages.
FlowError variants
FlowError::NotFound— 404, no matching routeFlowError::Loader(LoaderError)— #[load] failed with status + messageFlowError::Render(String)— page render panic or explicit error
not_found_page
FlowApp::new()
.not_found(|| not_found_page())
.serve(FlowServeOptions::default())
.awaiterror_page
match use_home_load() {
LoadValue::Ok(data) => render_home(&data),
LoadValue::Err(e) => error_page(&FlowError::Loader(e)),
LoadValue::Pending => view! { {stream_slot("home")} },
}LoaderError
LoaderError::new(404, "User not found")
LoaderError::new(500, "Database unavailable")Status codes
FlowError::status() returns the HTTP status — 404 for NotFound, the loader status for Loader errors, 500 for Render.