I have a failure hook in which I would want to send a mail with the exception that has been raised. Is there any way to access it?
# PIPELINE
@failure_hook
def email_message_on_failure(context: HookContext):
logging.exception(e)
mail_errors = Mail(
body=str(e)
)
mail_errors.send()