MCPcopy Create free account
hub / github.com/mitmproxy/mitmproxy / error_code_to_str

Function error_code_to_str

mitmproxy/proxy/layers/quic/_stream_layers.py:596–605  ·  view source on GitHub ↗

Returns the corresponding name of the given error code or a string containing its numeric value.

(error_code: int)

Source from the content-addressed store, hash-verified

594
595
596def error_code_to_str(error_code: int) -> str:
597 """Returns the corresponding name of the given error code or a string containing its numeric value."""
598
599 try:
600 return H3ErrorCode(error_code).name
601 except ValueError:
602 try:
603 return QuicErrorCode(error_code).name
604 except ValueError:
605 return f"unknown error (0x{error_code:x})"
606
607
608def is_success_error_code(error_code: int) -> bool:

Callers 4

test_error_code_to_strFunction · 0.90
_handle_eventMethod · 0.90
receive_dataMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_error_code_to_strFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…