From f698478b4f04cf3c1a79f40f38cd5998d6cb6147 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Mon, 8 May 2023 12:59:57 -0600 Subject: [PATCH] Prevent Nix from retrying if the GH backend errors out --- nix-actions-cache/src/error.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nix-actions-cache/src/error.rs b/nix-actions-cache/src/error.rs index cf9a423..cc02856 100644 --- a/nix-actions-cache/src/error.rs +++ b/nix-actions-cache/src/error.rs @@ -25,7 +25,8 @@ pub enum Error { impl IntoResponse for Error { fn into_response(self) -> Response { let code = match &self { - Self::ApiError(_) => StatusCode::INTERNAL_SERVER_ERROR, + // HACK: HTTP 418 makes Nix throw a visible error but not retry + Self::ApiError(_) => StatusCode::IM_A_TEAPOT, Self::NotFound => StatusCode::NOT_FOUND, Self::BadRequest => StatusCode::BAD_REQUEST, };