Something went wrong. Try again.
🏗️ Elegant & Highly Performant Async Gemini Server Framework for the Modern Age
async framework gemini-protocol protocol gemini rust
Something went wrong. Try again.
123456789101112131415161718192021222324252627//! `cargo run --example error_handler`
use windmark::response::Response;
#[windmark::main]async fn main() -> Result<(), Box<dyn std::error::Error>> { let mut error_count = 0;
windmark::router::Router::new() .set_private_key_file("windmark_private.pem") .set_certificate_file("windmark_public.pem") .set_error_handler(move |_| { error_count += 1;
println!("{} errors so far", error_count);
Response::permanent_failure("e") }) .mount("/error", |_| { let nothing = None::<String>;
Response::success(nothing.unwrap()) }) .run() .await}