full exception handling

This commit is contained in:
BarsTiger
2022-05-18 22:18:10 +03:00
parent e4198f4fa0
commit b0bbf6021b
3 changed files with 43 additions and 10 deletions

View File

@@ -0,0 +1,11 @@
from gui.functions import t_popup
from traceback import format_exception
def hook(type_, value, traceback):
t_popup("Unhandled exception", "An unhandled exception has occurred, \n"
"please check the console for more information.")
print("[!] Error happened")
print("Error type: ", type_.__name__)
print("Error value: ", value)
print("Error traceback: ", format_exception(type_, value, traceback)[2])