Merge pull request #35 from Kiskae/pass-through-429

Pass through HTTP 429 to the nix daemon
This commit is contained in:
Eelco Dolstra 2024-03-04 18:04:20 +01:00 committed by GitHub
commit fbf0bbed94
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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,