Skip to content

Commit 05b8886

Browse files
Raise RuntimeError instead of calling sys.exit in OutputsS_DA_GT.py
1 parent 3891928 commit 05b8886

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/geophires_x/OutputsS_DAC_GT.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,13 @@ def PrintOutputs(self, model) -> tuple:
9999

100100
except BaseException as ex:
101101
tb = sys.exc_info()[2]
102+
msg = "Error: GEOPHIRES failed to Failed to write the output file. Exiting...Line %i" % tb.tb_lineno
103+
102104
print(str(ex))
103-
print("Error: GEOPHIRES failed to Failed to write the output file. Exiting....Line %i" % tb.tb_lineno)
105+
print(msg)
104106
model.logger.critical(str(ex))
105-
model.logger.critical("Error: GEOPHIRES failed to Failed to write the output file. Exiting....Line %i" % tb.tb_lineno)
106-
sys.exit()
107+
model.logger.critical(msg)
108+
raise RuntimeError(msg, e)
107109

108110
model.logger.info(f'Complete {str(__class__)}: {__name__}')
109111

0 commit comments

Comments
 (0)