docs: def annotate_exception(self, exception: Exception, rule: ValidationRule = None) -> None:
          """
          Takes note of an exception occurred during validation.
          (Typically caused by an invalid attribute/key access inside get_rules() method)
  
          :param exception: Exception catched during validate() phase.
          :type exception: Exception
          :param rule: Validation rule that has generated the exception.
          :type rule: ValidationRule
          :return: None
          """
          error_key = rule.label if isinstance(rule, ValidationRule) else 'get_rules'
          if self.errors.get(error_key) is None:
              self.errors[error_key] = []
          self.errors[error_key].append(str(exception))