Skip to content

Commit 2ba5089

Browse files
authored
Merge pull request #3876 from jestabro/uncaught-conf-script-err-as-commit-err
configd: T6608: report uncaught config script exceptions as commit error
2 parents 9661e27 + 5034db8 commit 2ba5089

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/services/vyos-configd

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import json
2424
import typing
2525
import logging
2626
import signal
27+
import traceback
2728
import importlib.util
2829
import io
2930
from contextlib import redirect_stdout
@@ -136,9 +137,10 @@ def run_script(script_name, config, args) -> tuple[int, str]:
136137
except ConfigError as e:
137138
logger.error(e)
138139
return R_ERROR_COMMIT, str(e)
139-
except Exception as e:
140-
logger.critical(e)
141-
return R_ERROR_DAEMON, str(e)
140+
except Exception:
141+
tb = traceback.format_exc()
142+
logger.error(tb)
143+
return R_ERROR_COMMIT, tb
142144

143145
return R_SUCCESS, ''
144146

0 commit comments

Comments
 (0)