def insert_error(self, path, node):
        if len(path) == 1:
            field = path[0]
            if field in self.tree:
                if isinstance(self.tree[field], list):
                    self.tree[field].append(node)
                else:
                    self.tree[field] = [self.tree[field], node]
            else:
                self.tree[field] = node
        elif len(path) >= 1:
            if path[0] in self.tree:
                new = self.__class__(tree=copy(self.tree[path[0]]))
                new.insert_error(path[1:], node)
                self.tree[path[0]].update(new.tree)
            else:
                child_handler = self.__class__()
                child_handler.insert_error(path[1:], node)
                self.tree[path[0]] = child_handler.tree
Adds an error or sub-tree to :attr:tree.
dataset/ETHPy150Open nicolaiarocci/cerberus/cerberus/errors.py/BasicErrorHandler.insert_error