diff options
Diffstat (limited to 'src/controller/error.rs')
-rw-r--r-- | src/controller/error.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/controller/error.rs b/src/controller/error.rs index 2a84255..0f6dcc1 100644 --- a/src/controller/error.rs +++ b/src/controller/error.rs @@ -1,5 +1,7 @@ +use http_body_util::Full; +use hyper::body::Bytes; use hyper::header::CACHE_CONTROL; -use hyper::{Body, Response}; +use hyper::Response; use std::collections::HashMap; use tera::{Context, Tera}; @@ -7,7 +9,11 @@ use crate::controller::utils; use crate::controller::wallet::Wallet; // TODO error code -pub fn error(wallet: &Wallet, title: &str, message: &str) -> Response<Body> { +pub fn error( + wallet: &Wallet, + title: &str, + message: &str, +) -> Response<Full<Bytes>> { utils::with_headers( Response::new( template(&wallet.assets, &wallet.templates, title, message).into(), |