From b71e3397fd69c6ea63eaa6cd918bcd4b12fa424e Mon Sep 17 00:00:00 2001 From: uvjustin <46082645+uvjustin@users.noreply.github.com> Date: Sat, 23 Jul 2022 23:40:45 +0800 Subject: [PATCH] Add error message for duplicate stream recordings (#75654) --- homeassistant/components/stream/recorder.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/stream/recorder.py b/homeassistant/components/stream/recorder.py index b33a5fbbf84..42b98946c15 100644 --- a/homeassistant/components/stream/recorder.py +++ b/homeassistant/components/stream/recorder.py @@ -163,4 +163,10 @@ class RecorderOutput(StreamOutput): _LOGGER.error("Recording failed to capture anything") else: output.close() - os.rename(self.video_path + ".tmp", self.video_path) + try: + os.rename(self.video_path + ".tmp", self.video_path) + except FileNotFoundError: + _LOGGER.error( + "Error writing to '%s'. There are likely multiple recordings writing to the same file", + self.video_path, + )