Skip to content

Commit 6dbd4ab

Browse files
Raise RuntimeError instead of sys.exit in AGSOutputs
1 parent efe0034 commit 6dbd4ab

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/geophires_x/AGSOutputs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,12 @@ def PrintOutputs(self, model: Model):
222222

223223
except BaseException as ex:
224224
tb = sys.exc_info()[2]
225+
msg = "Error: GEOPHIRES Failed to write the output file. Exiting....Line %i" % tb.tb_lineno
225226
print(str(ex))
226-
print("Error: GEOPHIRES Failed to write the output file. Exiting....Line %i" % tb.tb_lineno)
227+
print(msg)
227228
model.logger.critical(str(ex))
228-
model.logger.critical(
229-
"Error: GEOPHIRES Failed to write the output file. Exiting....Line %i" % tb.tb_lineno)
229+
model.logger.critical(msg)
230230
traceback.print_exc()
231-
sys.exit()
231+
raise RuntimeError(msg)
232232

233233
model.logger.info(f'Complete {str(__class__)}: {sys._getframe().f_code.co_name}')

0 commit comments

Comments
 (0)