summaryrefslogtreecommitdiff
path: root/src/ui/error.rs
diff options
context:
space:
mode:
authorKit La Touche <kit@transneptune.net>2024-10-23 21:56:31 -0400
committerKit La Touche <kit@transneptune.net>2024-10-23 21:56:31 -0400
commit1f769855df2d9cf2bca883a0475670f227e3678b (patch)
tree6c94d9c868eb022588a07245df978478034ac5dd /src/ui/error.rs
parent8f360dd9cc45bb14431238ccc5e3d137c020fa7b (diff)
parent461814e5174cef1be3e07b4e4069314e9bcbedd6 (diff)
Merge branch 'main' into wip/mobile
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()
+ }
+}