Zentrader  <[EMAIL PROTECTED]> wrote:
>This is the "standard" way AFAIK
>.try :
>.   some_process
>.except :
>.   import trackback, sys
>.   et, ev, tb = sys.exc_info()
>.   while tb :
>.        co = tb.tb_frame.f_code
>.        print "Filename = " + str(co.co_filename)
>.        print  "Error Line # = " + str(traceback.tb_lineno(tb))
>.        tb = tb.tb_next
>.   print "error type = ", et
>.   print "error var name  = ", ev

Personally, I find:

try:
    some_process
except:
    import traceback
    traceback.print_exc()
    raise

just as informative and much easier to write.

-- 
\S -- [EMAIL PROTECTED] -- http://www.chaos.org.uk/~sion/
   "Frankly I have no feelings towards penguins one way or the other"
        -- Arthur C. Clarke
   her nu becomeþ se bera eadward ofdun hlæddre heafdes bæce bump bump bump
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to