base_validator.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:tripoli 作者: DDMAL 项目源码 文件源码
def log_error(self, field, msg):
        """Add an error to the validator.

        This method should not be overridden in subclasses, as doing so
        is likely to break the error and warning coercion decorators.

        :param field: The field the error was raised on.
        :param msg: The message to associate with the error.
        """
        if self.collect_errors:
            tb = traceback.extract_stack()[:-1] if self.debug else None
            err = ValidatorLogError(msg, self._path + (field,), tb)
            if self.verbose:
                self._IIIFValidator.logger.error(str(err))
            self._errors.add(err)
        if self.fail_fast:
            raise FailFastException
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号