Skip to content

Commit aff64a7

Browse files
Replace sys.exit with RuntimeError in SurfacePlantAGS
1 parent e6fc4d5 commit aff64a7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/geophires_x/SurfacePlantAGS.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -708,13 +708,13 @@ def Calculate(self, model: Model) -> None:
708708
:type model: :class:`~geophires_x.Model.Model`
709709
:return: None
710710
"""
711-
model.logger.info("Init " + str(__class__) + ": " + sys._getframe().f_code.co_name)
711+
model.logger.info(f'Init {__class__!s}: {sys._getframe().f_code.co_name}')
712712

713713
err = self.verify(model)
714714
if err > 0:
715-
model.logger.fatal("Error: GEOPHIRES failed to Failed to validate CLGS input value. Exiting....")
716-
print("Error: GEOPHIRES failed to Failed to validate CLGS input value. Exiting....")
717-
sys.exit()
715+
msg = 'Error: GEOPHIRES failed to validate CLGS input value. Exiting...'
716+
model.logger.fatal(msg)
717+
raise RuntimeError(msg)
718718
self.initialize(model)
719719

720720
self.Linear_production_temperature = model.wellbores.InterpolatedTemperatureArray

0 commit comments

Comments
 (0)