We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c8c3ae3 commit 868987eCopy full SHA for 868987e
pydumpling/helpers.py
@@ -1,4 +1,6 @@
1
+import sys
2
from traceback import print_tb, print_exception
3
+from .pydumpling import save_dumping
4
5
6
def print_traceback_and_except(dumpling_result):
@@ -10,3 +12,13 @@ def print_traceback_and_except(dumpling_result):
10
12
print_exception(exc_type, exc_value, exc_tb)
11
13
else:
14
print_tb(exc_tb)
15
+
16
17
+def catch_any_exception():
18
+ original_hook = sys.excepthook
19
20
+ def _hook(exc_type, exc_value, exc_tb):
21
+ save_dumping(exc_info=(exc_type, exc_value, exc_tb))
22
+ original_hook(exc_type, exc_value, exc_tb) # call sys original hook
23
24
+ sys.excepthook = original_hook
0 commit comments