diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2024-10-16 20:14:33 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2024-10-16 20:14:33 -0400 |
| commit | ea74daca4809e4008dd8d01039db9fff3be659d9 (patch) | |
| tree | 5972cabf646e8d5e635e9e2a176bff56c178461a /src/ui/error.rs | |
| parent | 56e16e29db55dae84549229d24b971f8bcf7da21 (diff) | |
Organizational pass on endpoints and routes.
Diffstat (limited to 'src/ui/error.rs')
| -rw-r--r-- | src/ui/error.rs | 18 |
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() + } +} |
