summaryrefslogtreecommitdiff
path: root/python/vyos/compose_config.py
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2024-06-19 20:31:06 -0500
committerJohn Estabrook <jestabro@vyos.io>2024-09-11 11:07:51 -0500
commit03fdc2302531efc4d99394739c5c11b8792ef46f (patch)
treef905241d06162f1f0461890096dc34545096ce0b /python/vyos/compose_config.py
parent461195c5046da1013a0cb201da917c41daf6f0dc (diff)
downloadvyos-1x-03fdc2302531efc4d99394739c5c11b8792ef46f.tar.gz
vyos-1x-03fdc2302531efc4d99394739c5c11b8792ef46f.zip
migration: T6447: add traceback on error
(cherry picked from commit 1c59315e9d14a4160b6e744ded08312aa8c70d11)
Diffstat (limited to 'python/vyos/compose_config.py')
-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.