(func)
return _filter
若某一函数出错(一般是网络请求), 会再次进行2次重新请求，否则会传回False
    @requestsExceptionFilter
    def test():
        requests.get('http://www.thereAreNothing.com')
    
    test()
    ---
    False
若某一函数出错(一般是网络请求), 会再次进行2次重新请求，否则会传回False
若某一函数出错 ( 一般是网络请求 ) 会再次进行2次重新请求，否则会传回False
def requestsExceptionFilter(func):
    """
    若某一函数出错(一般是网络请求), 会再次进行2次重新请求，否则会传回False
    @requestsExceptionFilter
    def test():
        requests.get('http://www.thereAreNothing.com')
    
    test()
    ---
    False
    """
    def _filter(*args, **kwargs):
        for i in range(3):
            try:
                return func(*args, **kwargs)
            except:
                logger.error("retry function {0} \n args {1},\n kwargs {2} \n times:{3}".format(func, args, kwargs, i), exc_info=True)
                continue
        else:
            logger.error("function {0} is wrong. args {1},\n kwargs {2}".format(func, args, kwargs), exc_info=True)
            return False
    
    return _filter
def requestsExceptionFilter ( func ) : def _filter ( * args , * * kwargs ) : for i in range ( 3 ) : try : return func ( * args , * * kwargs ) except : logger . error ( "retry function {0} \n args {1},\n kwargs {2} \n times:{3}" . format ( func , args , kwargs , i ) , exc_info = True ) continue else : logger . error ( "function {0} is wrong. args {1},\n kwargs {2}" . format ( func , args , kwargs ) , exc_info = True ) return False return _filter