Skip to content

Commit

Permalink
Merge pull request #3876 from jestabro/uncaught-conf-script-err-as-co…
Browse files Browse the repository at this point in the history
…mmit-err

configd: T6608: report uncaught config script exceptions as commit error
  • Loading branch information
dmbaturin authored Sep 25, 2024
2 parents 9661e27 + 5034db8 commit 2ba5089
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/services/vyos-configd
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import json
import typing
import logging
import signal
import traceback
import importlib.util
import io
from contextlib import redirect_stdout
Expand Down Expand Up @@ -136,9 +137,10 @@ def run_script(script_name, config, args) -> tuple[int, str]:
except ConfigError as e:
logger.error(e)
return R_ERROR_COMMIT, str(e)
except Exception as e:
logger.critical(e)
return R_ERROR_DAEMON, str(e)
except Exception:
tb = traceback.format_exc()
logger.error(tb)
return R_ERROR_COMMIT, tb

return R_SUCCESS, ''

Expand Down

0 comments on commit 2ba5089

Please sign in to comment.