2008-01-28, 15:48
Hello,
i'm a noob in XBMC python coding and I have a problem with WindowXML OnClick method : I use the following function for catch exceptions :
But it's don't work at all in OnClick methods
i'm a noob in XBMC python coding and I have a problem with WindowXML OnClick method : I use the following function for catch exceptions :
Code:
def Excepthook(type, value, tb):
"""
Intercept all exceptions out of try..except statements and
make the log.txt file with traceback
"""
log = open(HOME_DIR+"log.txt","w+")
log.write("Exception report\n\n")
lines=traceback.format_exception(type, value, tb)
log.write("---------------------Traceback lines-----------------------\n")
log.write("".join(lines))
log.write("-----------------------------------------------------------\n\n")
log.write("If you think this is a bug, please send me this file. Thank you.")
log.close()
msgbox("An exception occured. Look at the log.txt file.", title="Problem!") # it's a shortcut for Ok dialogs
sys.excepthook=Excepthook
But it's don't work at all in OnClick methods