def ERROR(txt='', hide_tb=False, notify=False):
if isinstance(txt, str):
txt = txt.decode("utf-8")
short = str(sys.exc_info()[1])
if hide_tb:
xbmc.log('script.plex: ERROR: {0} - {1}'.format(txt, short), xbmc.LOGERROR)
return short
import traceback
tb = traceback.format_exc()
xbmc.log("_________________________________________________________________________________", xbmc.LOGERROR)
xbmc.log('script.plex: ERROR: ' + txt, xbmc.LOGERROR)
for l in tb.splitlines():
xbmc.log(' ' + l, xbmc.LOGERROR)
xbmc.log("_________________________________________________________________________________", xbmc.LOGERROR)
xbmc.log("`", xbmc.LOGERROR)
if notify:
showNotification('ERROR: {0}'.format(short))
return short
评论列表
文章目录