summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2024-06-19 20:31:06 -0500
committerJohn Estabrook <jestabro@vyos.io>2024-06-26 15:38:41 -0500
commit1c59315e9d14a4160b6e744ded08312aa8c70d11 (patch)
tree878fb3a6fa78f0608424f98375fadcb75aa0a495
parent23356ee435344d8e9272f3a8a2273e00e7fca3ad (diff)
downloadvyos-1x-1c59315e9d14a4160b6e744ded08312aa8c70d11.tar.gz
vyos-1x-1c59315e9d14a4160b6e744ded08312aa8c70d11.zip
migration: T6447: add traceback on error
-rw-r--r--python/vyos/compose_config.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/python/vyos/compose_config.py b/python/vyos/compose_config.py
index efa28babe..208c89dad 100644
--- a/python/vyos/compose_config.py
+++ b/python/vyos/compose_config.py
@@ -17,6 +17,7 @@
config.
"""
+import traceback
from pathlib import Path
from typing import TypeAlias, Union, Callable
@@ -70,7 +71,9 @@ class ComposeConfig:
try:
self.apply_func(func)
except ComposeConfigError as e:
- raise ComposeConfigError(f'Error in {func_file}: {e}') from e
+ msg = str(e)
+ tb = f'{traceback.format_exc()}'
+ raise ComposeConfigError(f'Error in {func_file}: {msg}\n{tb}') from e
def to_string(self, with_version=False) -> str:
"""Return the rendered config tree.