From 984a930aa8dde14f0dfd8c978d4d7dab63487b80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Sun, 7 Mar 2021 23:57:46 +0100 Subject: [PATCH] chg: Avoid 500 on missing UUID --- lookyloo/lookyloo.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lookyloo/lookyloo.py b/lookyloo/lookyloo.py index 67463550..55fa112f 100644 --- a/lookyloo/lookyloo.py +++ b/lookyloo/lookyloo.py @@ -621,7 +621,10 @@ class Lookyloo(): def _get_raw(self, capture_uuid: str, extension: str='*', all_files: bool=True) -> BytesIO: '''Get file(s) from the capture directory''' - capture_dir = self.lookup_capture_dir(capture_uuid) + try: + capture_dir = self.lookup_capture_dir(capture_uuid) + except MissingUUID: + return BytesIO(f'Capture {capture_uuid} not unavailable, try again later.'.encode()) all_paths = sorted(list(capture_dir.glob(f'*.{extension}'))) if not all_files: # Only get the first one in the list