diff options
Diffstat (limited to 'src/error.rs')
-rw-r--r-- | src/error.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/error.rs b/src/error.rs index 08829a5..a49301a 100644 --- a/src/error.rs +++ b/src/error.rs @@ -5,7 +5,7 @@ use sputnik::request::QueryError; use sputnik::response::EmptyBuilder; use std::str::Utf8Error; -use crate::HyperResponse; +use crate::{HyperResponse, Page}; /// For convenience this enum also contains nonerroneous variants. #[derive(Debug)] @@ -84,11 +84,17 @@ impl From<Error> for HyperResponse { .unwrap(); } }; - // TODO: use Page Builder::new() .status(status) .header("content-type", "text/html") - .body(message.into()) + .body( + Page { + body: format!("<div>{}</div>", message), + ..Page::default() + } + .render() + .into(), + ) .unwrap() } } |