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
评论列表
文章目录