summaryrefslogtreecommitdiff
path: root/src/ui/error.rs
blob: 2dc627fb36c0d36280ead952bc3106d5a0162965 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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()
    }
}