Skip to content

Commit 4c8d93c

Browse files
committed
add try catch block
1 parent 9b66cd4 commit 4c8d93c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

reolinkapi/mixins/nvrdownload.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,11 @@ def get_playback_files(self, start: dt, end: dt = dt.now(), channel: int = 0,
3838
}
3939
}
4040
body = [{"cmd": "NvrDownload", "action": 1, "param": search_params}]
41-
42-
resp = self._execute_command('NvrDownload', body)[0]
41+
try:
42+
resp = self._execute_command('NvrDownload', body)[0]
43+
except Exception as e:
44+
print(f"Error: {e}")
45+
return []
4346
if 'value' not in resp:
4447
return []
4548
values = resp['value']

0 commit comments

Comments
 (0)