summaryrefslogtreecommitdiff
path: root/src/ui/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/error.rs')
-rw-r--r--src/ui/error.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/ui/error.rs b/src/ui/error.rs
new file mode 100644
index 0000000..2dc627f
--- /dev/null
+++ b/src/ui/error.rs
@@ -0,0 +1,18 @@
+use axum::{
+ http::StatusCode,
+ response::{IntoResponse, Response},
+};
+
+#[derive(Debug, thiserror::Error)]
+#[error("{0}")]
+pub struct NotFound<E>(pub E);
+
+impl<E> IntoResponse for NotFound<E>
+where
+ E: IntoResponse,
+{
+ fn into_response(self) -> Response {
+ let Self(response) = self;
+ (StatusCode::NOT_FOUND, response).into_response()
+ }
+}