diff options
Diffstat (limited to 'src/routes/error.rs')
-rw-r--r-- | src/routes/error.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/routes/error.rs b/src/routes/error.rs new file mode 100644 index 0000000..3813998 --- /dev/null +++ b/src/routes/error.rs @@ -0,0 +1,9 @@ +use poem::{IntoResponse, Response}; + +use crate::{ructe_poem::render, templates}; + +pub async fn error(err: poem::Error) -> Response { + let status = err.status().to_string(); + let message = err.to_string(); + render!(templates::error_html, &status, &message).into_response() +} |