MCPcopy
hub / github.com/keploy/keploy / isBenignReadErr

Function isBenignReadErr

pkg/agent/proxy/integrations/generic/encode_v2.go:277–290  ·  view source on GitHub ↗

isBenignReadErr reports whether err is one of the expected end-of-stream signals from a FakeConn.

(err error)

Source from the content-addressed store, hash-verified

275// isBenignReadErr reports whether err is one of the expected end-of-stream
276// signals from a FakeConn.
277func isBenignReadErr(err error) bool {
278 if err == nil {
279 return true
280 }
281 if errors.Is(err, io.EOF) || errors.Is(err, fakeconn.ErrClosed) {
282 return true
283 }
284 // net.Error with Timeout()=true — deadline expired, not an error.
285 type timeoutErr interface{ Timeout() bool }
286 if t, ok := err.(timeoutErr); ok && t.Timeout() {
287 return true
288 }
289 return false
290}

Callers 1

encodeGenericV2Function · 0.85

Calls 1

TimeoutMethod · 0.65

Tested by

no test coverage detected