Skip to content

Commit cb5d5b8

Browse files
committed
Catch oserror for ascii output
1 parent 410c614 commit cb5d5b8

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/mslice/models/workspacemanager/file_io.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,14 @@ def _get_slice_mdhisto_xye(histo_ws):
270270

271271

272272
def _output_data_to_ascii(output_path, out_data, header):
273-
np.savetxt(
274-
_to_absolute_path(str(output_path)), out_data, fmt="%12.9e", header=header
275-
)
273+
try :
274+
np.savetxt(
275+
_to_absolute_path(str(output_path)), out_data, fmt="%12.9e", header=header
276+
)
277+
except OSError as e:
278+
raise RuntimeError(
279+
f"Error occurred: {e}"
280+
)
276281

277282

278283
def _to_absolute_path(filepath: str) -> str:

0 commit comments

Comments
 (0)