From 4f38b8e9819d308e60c4cf23b1f9a4d4e3307e7a Mon Sep 17 00:00:00 2001 From: Samweli Date: Tue, 28 Feb 2023 09:30:19 +0300 Subject: [PATCH] catch STACTypeError when fetching from API --- src/qgis_stac/api/network.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/qgis_stac/api/network.py b/src/qgis_stac/api/network.py index 5014a23..26cd77f 100644 --- a/src/qgis_stac/api/network.py +++ b/src/qgis_stac/api/network.py @@ -47,6 +47,8 @@ from pystac_client import Client from pystac_client.exceptions import APIError +from pystac.errors import STACTypeError + from ..utils import log, tr from ..conf import settings_manager @@ -136,7 +138,12 @@ def run(self): self.pagination = ResourcePagination() else: raise NotImplementedError - except (APIError, NotImplementedError, JSONDecodeError) as err: + except ( + APIError, + NotImplementedError, + JSONDecodeError, + STACTypeError + ) as err: log(str(err)) self.error = str(err)