From: Ian Jackson Date: Tue, 4 May 2021 02:48:01 +0000 (+0100) Subject: bundles download: Fix http status codes X-Git-Tag: otter-0.6.0~388 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=fd21423547910b12fc647fd168eef4c99ddebffd;p=otter.git bundles download: Fix http status codes Signed-off-by: Ian Jackson --- diff --git a/daemon/main.rs b/daemon/main.rs index ae19e809..ad72d8c6 100644 --- a/daemon/main.rs +++ b/daemon/main.rs @@ -219,6 +219,13 @@ pub enum BundleDownloadError { display_as_debug!{BundleDownloadError} use BundleDownloadError as BDE; +impl<'r> Responder<'r> for BundleDownloadError { + fn respond_to(self, _: &rocket::Request) + -> Result, rocket::http::Status> { + Err((&self).into()) + } +} + impl From<&BundleDownloadError> for rocket::http::Status { fn from(e: &BundleDownloadError) -> rocket::http::Status { use rocket::http::Status as S;