From a1f20de5ba9eb193462583679471f3506a00ac8e Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Fri, 24 Feb 2023 18:55:06 +0100 Subject: [PATCH] fix: handle both 404 and 502 from L1s --- pool.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pool.go b/pool.go index 30b2910..eac11ea 100644 --- a/pool.go +++ b/pool.go @@ -504,7 +504,8 @@ func (p *pool) doFetch(ctx context.Context, from string, c cid.Cid, attempt int) return nil, fmt.Errorf("http error from strn: %d, err=%w", resp.StatusCode, ErrSaturnTimeout) } - if resp.StatusCode == http.StatusNotFound { + // This should only be 502, but L1s were not translating 404 from Lassie, so we have to support both for now. + if resp.StatusCode == http.StatusNotFound || resp.StatusCode == http.StatusBadGateway { return nil, fmt.Errorf("http error from strn: %d, err=%w", resp.StatusCode, ErrContentProviderNotFound) }