struct ErrorExample; impl sphinx::App for ErrorExample { fn initial_page(&mut self) -> Box { Box::new(ErrorExamplePage) } } struct ErrorExamplePage; impl sphinx::Page for ErrorExamplePage { fn name(&self) -> &str { "example-error" } fn on_error(&mut self, _err: Box) -> sphinx::Switch { println!("error handled by hook"); sphinx::ok!(); } fn render(&mut self, _ctx: sphinx::UpdateContext) -> sphinx::Switch { Err(Box::new(std::io::Error::new( std::io::ErrorKind::Unsupported, "demonstration error", ))) } } fn main() { tracing_subscriber::fmt().init(); sphinx::run(ErrorExample, sphinx::WindowOptions::default()); }