<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _validate(self, filehandle, metadata, catch_all_errors=False):
 """Runs all attached validators on the provided filehandle. In the base implmentation of Transfer, the result of `_validate` isn't checked. Rather validators are expected to raise UploadError to report failure. `_validate` can optionally catch all UploadErrors that occur or bail out and the first one by toggling the `catch_all_errors` flag. If catch_all_errors is Truthy then a single UploadError is raised consisting of all UploadErrors raised. """

        errors = []
        DEFAULT_ERROR_MSG = '{0!r}({1!r}, {2!r}) returned False'

        for validator in self._validators:
            try:
                if not validator(filehandle, metadata):
                    msg = DEFAULT_ERROR_MSG.format(validator, filehandle, metadata)
                    raise UploadError(msg)
            except UploadError as e:
                if catch_all_errors:
                    errors.append(e.args[0])
                else:
                    raise

        if errors:
            raise UploadError(errors)