stoptime-rs/src/catchers.rs

15 lines
303 B
Rust
Raw Normal View History

2019-07-10 20:55:32 +02:00
//! The application error catchers.
2019-06-09 18:16:55 +02:00
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",
})
}