mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2025-03-01 12:51:00 +00:00
The code is divided in three crates: - plume-common, for the ActivityPub module, and some common utils - plume-models, for the models and database-related code - plume, the app itself This new organization will allow to test it more easily, but also to create other tools that only reuse a little part of the code (for instance a Wordpress import tool, that would just use the plume-models crate)
22 lines
575 B
Rust
22 lines
575 B
Rust
use rocket_contrib::Template;
|
|
use rocket::Request;
|
|
use rocket::request::FromRequest;
|
|
use plume_models::users::User;
|
|
|
|
#[catch(404)]
|
|
fn not_found(req: &Request) -> Template {
|
|
let user = User::from_request(req).succeeded();
|
|
Template::render("errors/404", json!({
|
|
"error_message": "Page not found",
|
|
"account": user
|
|
}))
|
|
}
|
|
|
|
#[catch(500)]
|
|
fn server_error(req: &Request) -> Template {
|
|
let user = User::from_request(req).succeeded();
|
|
Template::render("errors/500", json!({
|
|
"error_message": "Server error",
|
|
"account": user
|
|
}))
|
|
}
|