Skip to content

Commit

Permalink
add try/except around run initialize
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelPesce committed Oct 15, 2024
1 parent 43aedf3 commit ebccb46
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion watertap/ui/fsapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,11 @@ def initialize(self, *args, **kwargs):
Return value of the underlying initialization function. Otherwise, return none
"""
if self.get_action(Actions.initialize) is not None:
return self.run_action(Actions.initialize, *args, **kwargs)
try:
result = self.run_action(Actions.initialize, *args, **kwargs)
except Exception as err:
raise RuntimeError(f"Initializing flowsheet: {err}") from err
return result
else:
return None

Expand Down

0 comments on commit ebccb46

Please sign in to comment.