Handle stream failures in recorder (#47151)
* Handle stream failures in recorder Fail gracefully with an error message when the recorder is invoked with no segments due to a stream failure. * Update homeassistant/components/stream/recorder.py Co-authored-by: uvjustin <46082645+uvjustin@users.noreply.github.com> Co-authored-by: uvjustin <46082645+uvjustin@users.noreply.github.com>
This commit is contained in:
parent
44ed6cda40
commit
715a254913
2 changed files with 17 additions and 0 deletions
|
@ -21,6 +21,11 @@ def async_setup_recorder(hass):
|
|||
|
||||
def recorder_save_worker(file_out: str, segments: Deque[Segment]):
|
||||
"""Handle saving stream."""
|
||||
|
||||
if not segments:
|
||||
_LOGGER.error("Recording failed to capture anything")
|
||||
return
|
||||
|
||||
if not os.path.exists(os.path.dirname(file_out)):
|
||||
os.makedirs(os.path.dirname(file_out), exist_ok=True)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue