Skip to content

Commit

Permalink
improove OPNsenseConfig errorhandling
Browse files Browse the repository at this point in the history
  • Loading branch information
rekup committed Sep 11, 2023
1 parent fa9cd90 commit 0c40633
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plugins/module_utils/config_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ def __exit__(self, exc_type, exc_val, exc_tb):
:raises RuntimeError: If changes are present which have not been saved.
:return:
"""
if exc_type:
raise exc_type(f"Exception occurred: {exc_val}")
if self.changed:
raise RuntimeError("Config has changed. Cannot exit without saving.")

Expand Down

0 comments on commit 0c40633

Please sign in to comment.