1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#[macro_use]
extern crate rocket;

use rocket::{Build, Rocket};

use rocket_sentry::RocketSentry;

#[get("/panic?<msg>")]
fn panic(msg: Option<String>) -> String {
    panic!("{}", msg.unwrap_or("You asked for it!".to_string()));
}

#[launch]
fn rocket() -> Rocket<Build> {
    rocket::build()
        .attach(RocketSentry::fairing())
        .mount("/", routes![panic])
}