-------- Error-return parser -------- errorReturnParser reads one client chunk, then returns a non-nil error without panicking. Mirrors the path real V2 parsers take when they hit a decode failure (invalid Content-Length, gzip header mismatch, malformed wire frame, etc.). The supervisor must classif
(_ context.Context, sess *supervisor.Session)
| 288 | // forwarding bytes end-to-end — same invariant the panic test |
| 289 | // asserts, but for the much more common error-return path. |
| 290 | func errorReturnParser(_ context.Context, sess *supervisor.Session) error { |
| 291 | _, _ = sess.ClientStream.ReadChunk() |
| 292 | return errParserDecode{} |
| 293 | } |
| 294 | |
| 295 | type errParserDecode struct{} |
| 296 |