def guarded(self, func, *args, **kwargs):
        """ Call a function, return None on errors.
        """
        try:
            return func(*args, **kwargs)
        except (EnvironmentError, error.LoggableError, xmlrpc.ERRORS) as g_exc:
            if func.__name__ not in self.ERRORS_LOGGED:
                self.LOG.warn("While calling '%s': %s" % (func.__name__, g_exc))
                self.ERRORS_LOGGED.add(func.__name__)
            return None
def guarded ( self , func , * args , ** kwargs ) : try : return func ( * args , ** kwargs ) except ( EnvironmentError , error . LoggableError , xmlrpc . ERRORS ) as g_exc : if func . __name__ not in self . ERRORS_LOGGED : self . LOG . warn ( "While calling '%s': %s" % ( func . __name__ , g_exc ) ) self . ERRORS_LOGGED . add ( func . __name__ ) return None
Call a function, return None on errors.