MCPcopy Create free account
hub / github.com/imroc/req / countReadFrameError

Method countReadFrameError

internal/http2/transport.go:2322–2345  ·  view source on GitHub ↗

countReadFrameError calls Transport.CountError with a string representing err.

(err error)

Source from the content-addressed store, hash-verified

2320// countReadFrameError calls Transport.CountError with a string
2321// representing err.
2322func (cc *ClientConn) countReadFrameError(err error) {
2323 f := cc.t.CountError
2324 if f == nil || err == nil {
2325 return
2326 }
2327 if ce, ok := err.(ConnectionError); ok {
2328 errCode := ErrCode(ce)
2329 f(fmt.Sprintf("read_frame_conn_error_%s", errCode.stringToken()))
2330 return
2331 }
2332 if errors.Is(err, io.EOF) {
2333 f("read_frame_eof")
2334 return
2335 }
2336 if errors.Is(err, io.ErrUnexpectedEOF) {
2337 f("read_frame_unexpected_eof")
2338 return
2339 }
2340 if errors.Is(err, errFrameTooLarge) {
2341 f("read_frame_too_large")
2342 return
2343 }
2344 f("read_frame_other")
2345}
2346
2347func (rl *clientConnReadLoop) run() error {
2348 cc := rl.cc

Callers 1

runMethod · 0.80

Calls 3

stringTokenMethod · 0.80
ErrCodeTypeAlias · 0.70
IsMethod · 0.45

Tested by

no test coverage detected