<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _do_check(self, handlers, terminate_func=None):
 """ checks the specified handlers. Returns True iff errors caught """

        corrections = []
        for h in handlers:
            try:
                if h.check():
                    if h.max_num_corrections is not None \
                            and h.n_applied_corrections >= h.max_num_corrections:
                        msg = "Maximum number of corrections {} reached " \
                              "for handler {}".format(h.max_num_corrections, h)
                        if h.raise_on_max:
                            self.run_log[-1]["handler"] = h
                            self.run_log[-1]["max_errors_per_handler"] = True
                            raise MaxCorrectionsPerHandlerError(msg, True, h.max_num_corrections, h)
                        else:
                            logger.warning(msg+" Correction not applied.")
                            continue
                    if terminate_func is not None and h.is_terminating:
                        logger.info("Terminating job")
                        terminate_func()
                        # make sure we don't terminate twice
                        terminate_func = None
                    d = h.correct()
                    d["handler"] = h
                    logger.error("\n" + pformat(d, indent=2, width=-1))
                    corrections.append(d)
                    h.n_applied_corrections += 1
            except Exception:
                if not self.skip_over_errors:
                    raise
                else:
                    import traceback
                    logger.error("Bad handler %s " % h)
                    logger.error(traceback.format_exc())
                    corrections.append(
                        {"errors": ["Bad handler %s " % h],
                         "actions": []})
        self.total_errors += len(corrections)
        self.errors_current_job += len(corrections)
        self.run_log[-1]["corrections"].extend(corrections)
        # We do a dump of the run log after each check.
        dumpfn(self.run_log, Custodian.LOG_FILE, cls=MontyEncoder,
               indent=4)
        return len(corrections) > 0