From 8e001d0f483e07194eb2b46dbede1e5171ebaed4 Mon Sep 17 00:00:00 2001 From: jteulade Date: Mon, 10 Jun 2024 10:22:16 +0200 Subject: [PATCH] #142: catch StopIteration and return InvalidProductError --- eoreader/products/optical/s2_product.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eoreader/products/optical/s2_product.py b/eoreader/products/optical/s2_product.py index c807f16b..44972536 100644 --- a/eoreader/products/optical/s2_product.py +++ b/eoreader/products/optical/s2_product.py @@ -582,7 +582,7 @@ def _get_res_band_folder(self, band_list: list, pixel_size: float = None) -> dic s2_bands_folder[band] = next( self.path.glob(f"{self._get_image_folder()}/{dir_name}") ) - except IndexError: + except (IndexError, StopIteration): s2_bands_folder[band] = self.path for band in band_list: