MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / script_error_handler

Function script_error_handler

mitmproxy/addons/script.py:60–71  ·  view source on GitHub ↗

Log errors during script loading.

(path: str, exc: Exception)

Source from the content-addressed store, hash-verified

58
59
60def script_error_handler(path: str, exc: Exception) -> None:
61 """
62 Log errors during script loading.
63 """
64 tback = exc.__traceback__
65 tback = addonmanager.cut_traceback(
66 tback, "invoke_addon_sync"
67 ) # we're calling configure() on load
68 tback = addonmanager.cut_traceback(
69 tback, "_call_with_frames_removed"
70 ) # module execution from importlib
71 logger.error(f"error in script {path}", exc_info=(type(exc), exc, tback))
72
73
74ReloadInterval = 1

Callers 2

load_scriptFunction · 0.85
loadscriptMethod · 0.85

Calls 1

errorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…