Skip to content

Commit

Permalink
Merge pull request #35 from Kiskae/pass-through-429
Browse files Browse the repository at this point in the history
Pass through HTTP 429 to the nix daemon
  • Loading branch information
edolstra authored Mar 4, 2024
2 parents f7e335a + 606006b commit fbf0bbe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions magic-nix-cache/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ pub enum Error {
impl IntoResponse for Error {
fn into_response(self) -> Response {
let code = match &self {
Self::Api(gha_cache::api::Error::ApiError {
status: StatusCode::TOO_MANY_REQUESTS,
..
}) => StatusCode::TOO_MANY_REQUESTS,
// HACK: HTTP 418 makes Nix throw a visible error but not retry
Self::Api(_) => StatusCode::IM_A_TEAPOT,
Self::NotFound => StatusCode::NOT_FOUND,
Expand Down

0 comments on commit fbf0bbe

Please sign in to comment.