I have some code with a try and except try: function_that_rises_many_types_of_exceptions() except: print "error, but I don't know what was happend!" I use except without any argument to catch all kind of exceptions. But how can I get the type of exception without having to write down all exceptions? Is there function like GetLastException() ?