Skip to content
This repository was archived by the owner on Jul 19, 2021. It is now read-only.

Commit

Permalink
Raise exception on config error
Browse files Browse the repository at this point in the history
  • Loading branch information
ManInFez committed Apr 16, 2019
1 parent 53fd5f6 commit f5cc33b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions python/res/enkf/res_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ def __init__(self, user_config_file=None, config=None, throw_on_error=True):
else:
raise ValueError("No config provided")

if self.errors and throw_on_error:
raise ValueError("Error loading configuration")


config_dir = config_content.getValue(ConfigKeys.CONFIG_DIRECTORY)
Expand Down Expand Up @@ -131,10 +133,10 @@ def __init__(self, user_config_file=None, config=None, throw_on_error=True):

c_ptr = None

if not self.errors or not throw_on_error:
for conf in configs:
conf.convertToCReference(None)
c_ptr = self._alloc_full(config_dir, user_config_file, *configs)

for conf in configs:
conf.convertToCReference(None)
c_ptr = self._alloc_full(config_dir, user_config_file, *configs)


if c_ptr:
Expand Down

0 comments on commit f5cc33b

Please sign in to comment.