Pass through HTTP 429 to the nix daemon
This commit is contained in:
parent
369a0a0a5a
commit
606006b931
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue