TNO Intern

Commit 51e704d9 authored by Arjo Segers's avatar Arjo Segers
Browse files

Trap errors from "requests.get" during inquire.

parent 822cdb96
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -4,6 +4,9 @@
# 2023-10, Arjo Segers
#   Tools to access Copernicus DataSpace.
#
# 2023-10, Arjo Segers
#   Trap errors from "requests.get" during inquire.
#

########################################################################
###
@@ -293,10 +296,10 @@ class CSO_DataSpace_Inquire(utopya.UtopyaRc):
            maxtry = 5
            # repeat a few times if necessary:
            while ntry <= maxtry:
                try:
                    # send query to search page; no authorization is needed ...
                    r = requests.get(search_url, params=params)
                    # check status, raise error if request failed:
                try:
                    r.raise_for_status()
                except Exception as err:
                    msg = str(err)