MCPcopy Create free account
hub / github.com/rthalley/dnspython / _check_status

Function _check_status

dns/query.py:659–673  ·  view source on GitHub ↗
(headers: dns.quic.Headers, peer: str, wire: bytes)

Source from the content-addressed store, hash-verified

657
658
659def _check_status(headers: dns.quic.Headers, peer: str, wire: bytes) -> None:
660 value = _find_header(headers, b":status")
661 if value is None:
662 raise SyntaxError("no :status header in response")
663 status = int(value)
664 if status < 0:
665 raise SyntaxError("status is negative")
666 if status < 200 or status > 299:
667 error = ""
668 if len(wire) > 0:
669 try:
670 error = ": " + wire.decode()
671 except Exception:
672 pass
673 raise ValueError(f"{peer} responded with status code {status}{error}")
674
675
676def _http3(

Callers 2

_http3Function · 0.90
_http3Function · 0.85

Calls 3

_find_headerFunction · 0.85
SyntaxErrorClass · 0.85
decodeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…