propapating exceptions
Quinn Dunkan
quinn at lira.ugcs.caltech.edu
Fri Jul 16 19:26:17 EDT 1999
More information about the Python-list mailing list
Fri Jul 16 19:26:17 EDT 1999
- Previous message (by thread): propapating exceptions
- Next message (by thread): propapating exceptions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I've lately found myself in the position of wanting to catch exceptions based on their attributes, rather than on the exception itself. So (in mal's odbc module): try: some sql command except ODBC.MySQL.OperationalError, msg: if msg[1] == CR_SERVER_GONE_ERROR: # (snarfed out of errmsg.h) restart server, try again else: raise sys.exc_info()[0], sys.exc_info()[1] It's a rather wordy way to pass the exception on without touching it, and I still lose the traceback info. Is there a better way to pass on an exception as if it had never been caught?
- Previous message (by thread): propapating exceptions
- Next message (by thread): propapating exceptions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list