Changeset 1513 for pykota

Show
Ignore:
Timestamp:
06/02/04 16:25:07 (20 years ago)
Author:
jalet
Message:

Should correctly capture ALL errors now

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/cupspykota

    r1503 r1513  
    2424# 
    2525# $Log$ 
     26# Revision 1.55  2004/06/02 14:25:07  jalet 
     27# Should correctly capture ALL errors now 
     28# 
    2629# Revision 1.54  2004/05/26 16:44:48  jalet 
    2730# Now logs something when client hostname can't be extracted 
     
    656659            kotabackend = PyKotaBackend()     
    657660            retcode = kotabackend.mainWork() 
    658         except (PyKotaToolError, PyKotaConfigError, PyKotaStorageError, PyKotaAccounterError, AttributeError, KeyError, IndexError, ValueError, TypeError, IOError), msg : 
     661        except : 
    659662            import traceback 
    660             mm = [((f.endswith('\n') and f) or (f + '\n')) for f in traceback.format_exception(*sys.exc_info())] 
    661             sys.stderr.write("ERROR : cupspykota backend failed (%s)\n%s" % (msg, "ERROR : ".join(mm))) 
     663            lines = [] 
     664            for line in traceback.format_exception(*sys.exc_info()) : 
     665                lines.extend([l for l in line.split("\n") if l]) 
     666            sys.stderr.write("ERROR : cupspykota backend failed : \n%s" % (msg, "ERROR : ".join(["%s\n" % l for l in lines]))) 
    662667            sys.stderr.flush() 
    663668            retcode = 1