def on_error(self, content):
        """
        In case of error, conf['error'] is checked for policy name.
        It can be 'ignore', or 'notify' (default).
        Ignore policy replaces content with None,
        Notify policy passes content through.
        """
        error_policy = self.conf.get('error', 'notify')
        if error_policy == 'ignore':
            if content:
                logger.error("Ignoring error in %s",
                             repr(content)[:60])
            return None
        elif error_policy == 'notify':
            logger.debug("Notifying on error")
            return content
        else:
            logger.warning("Unknown error policy: %r", error_policy)
            logger.info("Defaulting to 'notify'")
            return content
def on_error ( self , content ) : error_policy = self . conf . get ( 'error' , 'notify' ) if error_policy == 'ignore' : if content : logger . error ( "Ignoring error in %s" , repr ( content ) [ : 60 ] ) return None elif error_policy == 'notify' : logger . debug ( "Notifying on error" ) return content else : logger . warning ( "Unknown error policy: %r" , error_policy ) logger . info ( "Defaulting to 'notify'" ) return content
In case of error, conf['error'] is checked for policy name.
        It can be 'ignore', or 'notify' (default).
        Ignore policy replaces content with None,
        Notify policy passes content through.