diff options
Diffstat (limited to 'func/utils.py')
-rwxr-xr-x | func/utils.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/func/utils.py b/func/utils.py index 54c9c39..4aca97e 100755 --- a/func/utils.py +++ b/func/utils.py @@ -45,9 +45,12 @@ def daemonize(pidfile=None): def nice_exception(etype, evalue, etb): etype = str(etype) - lefti = etype.index("'") + 1 - righti = etype.rindex("'") - nicetype = etype[lefti:righti] + try: + lefti = etype.index("'") + 1 + righti = etype.rindex("'") + nicetype = etype[lefti:righti] + except: + nicetype = etype nicestack = string.join(traceback.format_list(traceback.extract_tb(etb))) return [ REMOTE_ERROR, nicetype, str(evalue), nicestack ] |