Skip to content

Commit 761bb29

Browse files
authored
Merge pull request #601 from tisnik/lcore-625-catch-storing-transcript-issues
LCORE-625: catch storing transcript issues
2 parents 13589df + 890a436 commit 761bb29

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/utils/transcripts.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ def store_transcript( # pylint: disable=too-many-arguments,too-many-positional-
8080

8181
# stores feedback in a file under unique uuid
8282
transcript_file_path = transcripts_path / f"{get_suid()}.json"
83-
with open(transcript_file_path, "w", encoding="utf-8") as transcript_file:
84-
json.dump(data_to_store, transcript_file)
83+
try:
84+
with open(transcript_file_path, "w", encoding="utf-8") as transcript_file:
85+
json.dump(data_to_store, transcript_file)
86+
except (IOError, OSError) as e:
87+
logger.error("Failed to store transcript into %s: %s", transcript_file_path, e)
88+
raise
8589

8690
logger.info("Transcript successfully stored at: %s", transcript_file_path)

0 commit comments

Comments
 (0)