How to manage error notifications for background tasks

The except Exception as e: will catch all exceptions and the f'Error:<br>\n{traceback.format_exc()} will include in the email the whole traceback the way you would see it in the console, including the type of the exception.

3 Likes