rocket-errors 0.1.0

A library for handling errors with anyhow and eyre in Rocket applications.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use rocket::{get, routes};
use rocket_errors::eyre;

#[get("/")]
pub fn health_check() -> eyre::Result<&'static str> {
    Ok("Hello, world!")
}

#[rocket::main]
async fn main() -> eyre::Result<()> {
    let _ = rocket::build()
        .mount("/hc", routes![health_check])
        .launch()
        .await?;
    Ok(())
}