diff options
| author | Kit La Touche <kit@transneptune.net> | 2024-10-10 13:26:15 -0400 |
|---|---|---|
| committer | Kit La Touche <kit@transneptune.net> | 2024-10-10 13:26:15 -0400 |
| commit | 03f8d9ad603a4e523a0e2a0e60ad62c8725f0875 (patch) | |
| tree | b01543c0c2dadbd4be17320d47fc2e3d2fdb280d /src/error.rs | |
| parent | efae871b1bdb1e01081a44218281950cf0177f3b (diff) | |
| parent | d173bc08f2b699f58c8cca752ff688ad46f33ced (diff) | |
Merge branch 'main' into wip/path-routing-for-channels
Diffstat (limited to 'src/error.rs')
| -rw-r--r-- | src/error.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs index 8792a1d..85573d4 100644 --- a/src/error.rs +++ b/src/error.rs @@ -69,3 +69,15 @@ impl IntoResponse for Unauthorized { (StatusCode::UNAUTHORIZED, "unauthorized").into_response() } } + +pub struct NotFound<E>(pub E); + +impl<E> IntoResponse for NotFound<E> +where + E: std::error::Error, +{ + fn into_response(self) -> Response { + let Self(response) = self; + (StatusCode::NOT_FOUND, response.to_string()).into_response() + } +} |
