aboutsummaryrefslogtreecommitdiffstats
path: root/adenosine-pds/src
diff options
context:
space:
mode:
Diffstat (limited to 'adenosine-pds/src')
-rw-r--r--adenosine-pds/src/lib.rs2
-rw-r--r--adenosine-pds/src/web.rs8
2 files changed, 9 insertions, 1 deletions
diff --git a/adenosine-pds/src/lib.rs b/adenosine-pds/src/lib.rs
index 2414b79..c70cb88 100644
--- a/adenosine-pds/src/lib.rs
+++ b/adenosine-pds/src/lib.rs
@@ -250,7 +250,7 @@ impl AtpService {
(GET) ["/xrpc/{endpoint}", endpoint: String] => {
xrpc_wrap(xrpc_get_handler(&srv, &endpoint, request))
},
- _ => Response::text("404: Not Found")
+ _ => web_wrap(Err(XrpcError::NotFound("unknown URL pattern".to_string()).into())),
)
})
});
diff --git a/adenosine-pds/src/web.rs b/adenosine-pds/src/web.rs
index 5b9d6de..4432566 100644
--- a/adenosine-pds/src/web.rs
+++ b/adenosine-pds/src/web.rs
@@ -5,6 +5,14 @@ use askama::Template;
use serde_json;
#[derive(Template)]
+#[template(path = "error.html")]
+pub struct ErrorView {
+ pub domain: String,
+ pub status_code: u16,
+ pub error_message: String,
+}
+
+#[derive(Template)]
#[template(path = "home.html")]
pub struct GenericHomeView {
pub domain: String,