Posted By

eristoddle on 08/04/11


Tagged


Versions (?)

Python Catch All Exceptions


 / Published in: Python
 

  1. try:
  2. dosomething()
  3. print "Record Added"
  4. except: # catch *all* exceptions
  5. e = sys.exc_info()[1]
  6. print "Error: %s" % e

Report this snippet  

You need to login to post a comment.