MCPcopy Index your code
hub / github.com/HelloZeroNet/ZeroNet / handleError

Function handleError

src/Debug/DebugHook.py:29–44  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

27
28# Store last error, ignore notify, allow manual error logging
29def handleError(*args, **kwargs):
30 global last_error
31 if not args: # Manual called
32 args = sys.exc_info()
33 silent = True
34 else:
35 silent = False
36 if args[0].__name__ != "Notify":
37 last_error = args
38
39 if args[0].__name__ == "KeyboardInterrupt":
40 shutdown("Keyboard interrupt")
41 elif not silent and args[0].__name__ != "Notify":
42 logging.exception("Unhandled exception")
43 if "greenlet.py" not in args[2].tb_frame.f_code.co_filename: # Don't display error twice
44 sys.__excepthook__(*args, **kwargs)
45
46
47# Ignore notify errors

Callers

nothing calls this directly

Calls 1

shutdownFunction · 0.85

Tested by

no test coverage detected