Caught this one while fuzzing @mitmproxy: receive_data raises a ValueError under specific circumstances, it should raise a ProtocolError instead.
import h2.connection
conn = h2.connection.H2Connection()
conn.send_headers(1, [
(':authority', 'example.com'),
(':path', '/'),
(':scheme', 'https'),
(':method', 'GET'),
])
conn.reset_stream(1)
# the following raises ValueError: Stream ID must be non-zero
conn.receive_data(b'\x00\x00\x07\x05\x04\x00\x00\x00\x01\x00\x00\x00\x00\x84\x86\x82')
(full traceback)