We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent da067bc commit e662fcfCopy full SHA for e662fcf
1 file changed
src/app/endpoints/feedback.py
@@ -145,8 +145,12 @@ def store_feedback(user_id: str, feedback: dict) -> None:
145
146
# stores feedback in a file under unique uuid
147
feedback_file_path = storage_path / f"{get_suid()}.json"
148
- with open(feedback_file_path, "w", encoding="utf-8") as feedback_file:
149
- json.dump(data_to_store, feedback_file)
+ try:
+ with open(feedback_file_path, "w", encoding="utf-8") as feedback_file:
150
+ json.dump(data_to_store, feedback_file)
151
+ except (OSError, IOError) as e:
152
+ logger.error("Failed to store feedback at %s: %s", feedback_file_path, e)
153
+ raise
154
155
logger.info("Feedback stored successfully at %s", feedback_file_path)
156
0 commit comments