<s> from __future__ import division , print_function , absolute_import <EOL> from celery . signals import task_failure <EOL> import bugsnag <EOL> def failure_handler ( sender , task_id , exception , args , kwargs , traceback , einfo , <EOL> ** kw ) : <EOL> task = { <EOL> "<STR_LIT>" : task_id , <EOL> "<STR_LIT:args>" : args , <EOL> "<STR_LIT>" : kwargs <EOL> } <EOL> bugsnag . auto_notify ( exception , traceback = traceback , <EOL> context = sender . name , <EOL> extra_data = task ) <EOL> def connect_failure_handler ( ) : <EOL> """<STR_LIT>""" <EOL> task_failure . connect ( failure_handler , weak = False ) </s>
