Skip to content

Commit

Permalink
Change default to False for should_exit_on_error
Browse files Browse the repository at this point in the history
  • Loading branch information
mcarans committed Jan 14, 2025
1 parent 96bde80 commit 17bf070
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/hdx/utilities/error_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ class ErrorHandler:
sorted.
Args:
should_exit_on_error (bool): Whether to exit with a 1 code if there are errors. Default is True.
should_exit_on_error (bool): Whether to exit with a 1 code if there are errors. Default is False.
"""

def __init__(
self,
should_exit_on_error: bool = True,
should_exit_on_error: bool = False,
):
self.should_exit_on_error = should_exit_on_error
self.shared_errors = {
Expand Down
2 changes: 1 addition & 1 deletion tests/hdx/utilities/test_error_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_error_handler(self, caplog):
assert len(errors.shared_errors["error"]) == 0
with pytest.raises(SystemExit):
with caplog.at_level(logging.ERROR):
with ErrorHandler() as errors:
with ErrorHandler(should_exit_on_error=True) as errors:
errors.add("this is a error!")
errors.add("this is a warning!", "warning 1", "warning")
errors.add_missing_value(
Expand Down

0 comments on commit 17bf070

Please sign in to comment.