stoptime-rs/src/catchers.rs

15 lines
303 B
Rust

//! The application error catchers.
use rocket::catch;
use rocket_contrib::json;
use rocket_contrib::json::JsonValue;
/// Catches an HTTP 404 (Not Found) error.
#[catch(404)]
pub fn not_found() -> JsonValue {
json!({
"status": "error",
"reason": "Resource was not found",
})
}