Skip to content

Commit

Permalink
Merge pull request #20 from rekup/feature/OPNsenseConfig-error-handling
Browse files Browse the repository at this point in the history
improove OPNsenseConfig errorhandling
  • Loading branch information
rekup authored Sep 12, 2023
2 parents fa9cd90 + 0c40633 commit 441e23c
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 441e23c

Please sign in to comment.