diff --git a/sen2chain/download_eodag.py b/sen2chain/download_eodag.py index 74299dce161ed1ac9e4d003053e1eb1f069476bf..ad4352248233a6e35f3ab3dac788a844c5cbbf5e 100644 --- a/sen2chain/download_eodag.py +++ b/sen2chain/download_eodag.py @@ -19,6 +19,12 @@ from eodag.utils.logging import get_logging_verbose from threading import Thread import multiprocessing from simplejson import JSONDecodeError +from urllib3.exceptions import ( + ConnectTimeoutError, MaxRetryError, + NewConnectionError, SSLError, + ReadTimeoutError, +) +from requests.exceptions import ConnectTimeout from .config import SHARED_DATA, Config from .utils import get_tile, set_permissions @@ -77,10 +83,17 @@ class S2cEodag: **default_search_criteria ) logging.disable(logging.NOTSET) - except JSONDecodeError: + except (ConnectTimeout, MaxRetryError, TimeoutError, ConnectTimeoutError): logging.disable(logging.NOTSET) - logger.info("Issue with this tile search for now, pass") - pass + logger.info("Issue with this tile search for now, should try to increase the timeout for this provider or check your internet connexion") + self.products = [] + pass + except: + logging.disable(logging.NOTSET) + logger.info("An error occured check everything") + self.products = [] + pass + # if not isinstance(ref, list): # ref_string = ref