python: How do I know what type of exception occurred?

I have a function called by the main program:

try:
    someFunction()
except:
    print "exception happened!"

but in the middle of the execution of the function it raises exception, so it jumps to the except part.

How can I see exactly what happened in the someFunction() that caused the exception to happen?

15 Answers
15

Leave a Comment