MCPcopy
hub / github.com/mitmproxy/mitmproxy / handle_error

Method handle_error

mitmproxy/proxy/layers/dns.py:103–110  ·  view source on GitHub ↗
(self, flow: dns.DNSFlow, err: str)

Source from the content-addressed store, hash-verified

101 yield commands.SendData(self.context.client, packed)
102
103 def handle_error(self, flow: dns.DNSFlow, err: str) -> layer.CommandGenerator[None]:
104 flow.error = mflow.Error(err)
105 yield DnsErrorHook(flow)
106 servfail = flow.request.fail(response_codes.SERVFAIL)
107 yield commands.SendData(
108 self.context.client,
109 pack_message(servfail, flow.client_conn.transport_protocol),
110 )
111
112 def unpack_message(self, data: bytes, from_client: bool) -> List[dns.DNSMessage]:
113 msgs: List[dns.DNSMessage] = []

Callers 1

handle_requestMethod · 0.95

Calls 3

DnsErrorHookClass · 0.85
pack_messageFunction · 0.85
failMethod · 0.80

Tested by

no test coverage detected