Exception passing

Thomas Dybdahl Ahle lobais at gmail.com
Fri Mar 23 10:29:17 EDT 2007


Hi, I have a function, which looks like the following:

connecting = False
def func ():
    global connecting
    connecting = True
    try:
       # Do lot of network stuff
    except Exception, e:
        connecting = False
        raise e

This works quite good, but it is a hell to debug. Instead of getting a 
log message to the line which originally raised the exception.

Is there anyway to reraise an exception, but preserve the log?



More information about the Python-list mailing list