From a57ad562757815958b749f7d5068b53090509afb Mon Sep 17 00:00:00 2001 From: hrt/derrandz Date: Wed, 10 May 2023 07:19:38 +0100 Subject: [PATCH] fix(share/p2p/shrexeds): return correct err on context error (#2177) Resolves item 7 on https://github.com/celestiaorg/celestia-node/issues/2176 --- share/p2p/shrexeds/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/p2p/shrexeds/client.go b/share/p2p/shrexeds/client.go index dccb5ce06a..5f3470179e 100644 --- a/share/p2p/shrexeds/client.go +++ b/share/p2p/shrexeds/client.go @@ -57,7 +57,7 @@ func (c *Client) RequestEDS( log.Debugw("client: eds request to peer failed", "peer", peer, "hash", dataHash.String(), "error", err) if errors.Is(err, context.DeadlineExceeded) || errors.Is(err, context.Canceled) { c.metrics.ObserveRequests(1, p2p.StatusTimeout) - return nil, ctx.Err() + return nil, err } // some net.Errors also mean the context deadline was exceeded, but yamux/mocknet do not // unwrap to a ctx err