I'm doing some DB updates during my python application so I need to catch all exceptions (i.e. except
without type or with general Exception
type) to rollback DB
But I also need to re-raise the exception for parent functions in the call stack so they can do their clean up too.
I can re-raise the exception by wrapping them in Exception
class but i need to preserve their type
How can I re-raise catched exception of any type preserving their type and data in python?