Q: Catching any exception an printing it
Stuart Reynolds
S.I.Reynolds at cs.bham.ac.uk
Mon Feb 21 13:27:33 EST 2000
More information about the Python-list mailing list
Mon Feb 21 13:27:33 EST 2000
- Previous message (by thread): could help out a newbie? I WOULD APPRECIATE ANY TIPS
- Next message (by thread): Q: Catching any exception an printing it
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Python allows you to do,
try:
if a:
raise SomeException()
else:
raise xyz()
except:
print 'There was an error'
but is it possible to print out the exception if you don't know what
type it is? I'd like the above error message to be more useful, but the
exception raised inside the try block could be anything. Is it possible
to find the last exception raised?
Cheers,
Stuart
- Previous message (by thread): could help out a newbie? I WOULD APPRECIATE ANY TIPS
- Next message (by thread): Q: Catching any exception an printing it
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list