connError returns ConnectionError(code) but first stashes away a public reason to the caller can optionally relay it to the peer before hanging up on them. This might help others debug their implementations.
(code ErrCode, reason string)
| 588 | // to the peer before hanging up on them. This might help others debug |
| 589 | // their implementations. |
| 590 | func (h2f *Framer) connError(code ErrCode, reason string) error { |
| 591 | h2f.errDetail = errors.New(reason) |
| 592 | return ConnectionError(code) |
| 593 | } |
| 594 | |
| 595 | // checkFrameOrder reports an error if f is an invalid frame to return |
| 596 | // next from ReadFrame. Mostly it checks whether HEADERS and |
no test coverage detected