Handle worker exceptions in transaction to keep the database name
The run_task() method of worker.py is handling the Exception only when the transaction is closed, so if we are using a log handler we are not getting the database name. adding the except Exception before the transaction is closed.