def some_check(data):
# ... some checks
pass
CHECKS = (
some_check,
)
def check_outgoing_data(records_iterator)
for record in records_iterator:
for check in CHECKS:
try:
check(record)
except ValueError, e:
logging.error("Fail to run %s at %d record: %s" %
(check.__name__, i, e))