From 375fbb1560a0a846452b4e0ad801bff35da6f6e4 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 4 Jul 2020 16:51:58 +0100 Subject: [PATCH] error handling --- src/bin/server.rs | 2 +- src/http.rs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/bin/server.rs b/src/bin/server.rs index 04a6ec12..685045a4 100644 --- a/src/bin/server.rs +++ b/src/bin/server.rs @@ -201,7 +201,7 @@ fn api_move(form : Json) -> impl response::Responder<'static> { } #[get("/_/updates//")] -#[throws(rocket::response::Debug)] +#[throws(OE)] fn updates(ctoken : InstanceAccess, gen: u64) -> impl response::Responder<'static> { let gen = Generation(gen); diff --git a/src/http.rs b/src/http.rs index 528bbcf4..292466e1 100644 --- a/src/http.rs +++ b/src/http.rs @@ -8,9 +8,8 @@ impl<'r> Responder<'r> for OnlineError { #[throws(Status)] fn respond_to(self, req: &Request) -> Response<'r> { let msg = format!("Online-layer error\n{:?}\n{}\n", self, self); - use rocket::http::Status;//::Continue; + use rocket::http::Status; use OnlineError::*; - let s = rocket::http::Status::Ok; let status = match self { GameCorrupted => Status::InternalServerError, NoClient | NoPlayer => Status::NotFound, -- 2.30.2