Skip to content

Commit

Permalink
Merge pull request #1789 from jestabro/insert_error
Browse files Browse the repository at this point in the history
configtree: T4961: improve error reporting of function copy
  • Loading branch information
c-po committed Jan 28, 2023
2 parents e6023a3 + dcfde8d commit 248d4ed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/vyos/configtree.py
Expand Up @@ -242,7 +242,8 @@ def copy(self, old_path, new_path):
raise ConfigTreeError()
res = self.__copy(self.__config, oldpath_str, newpath_str)
if (res != 0):
raise ConfigTreeError("Path [{}] doesn't exist".format(old_path))
msg = self.__get_error().decode()
raise ConfigTreeError(msg)

if self.__migration:
print(f"- op: copy old_path: {old_path} new_path: {new_path}")
Expand Down

0 comments on commit 248d4ed

Please sign in to comment.