MCPcopy
hub / github.com/mitmproxy/mitmproxy / safecall

Function safecall

mitmproxy/addonmanager.py:45–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

43
44@contextlib.contextmanager
45def safecall():
46 try:
47 yield
48 except (exceptions.AddonHalt, exceptions.OptionsError):
49 raise
50 except Exception:
51 etype, value, tb = sys.exc_info()
52 tb = cut_traceback(tb, "invoke_addon_sync")
53 tb = cut_traceback(tb, "invoke_addon")
54 assert etype
55 assert value
56 logger.error(
57 f"Addon error: {value}",
58 exc_info=(etype, value, tb),
59 )
60
61
62class Loader:

Callers 2

trigger_eventMethod · 0.85
triggerMethod · 0.85

Calls 2

cut_tracebackFunction · 0.85
errorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…