From 173a4bc66e09e0093cf959d261f85945021d9c66 Mon Sep 17 00:00:00 2001 From: tsanona Date: Thu, 26 Nov 2020 14:28:20 +0100 Subject: [PATCH] Mr corrections --- gts2_client/gts2_client.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gts2_client/gts2_client.py b/gts2_client/gts2_client.py index bdc2567..994733d 100755 --- a/gts2_client/gts2_client.py +++ b/gts2_client/gts2_client.py @@ -795,21 +795,21 @@ def client(outpath="", out_prefix="", out_mode="json", geo_ll=(), geo_ur=(), sen "onlytime": onlytime, "timeout": timeout} # actual API request - logger.info(msg="Requesting data from the GTS2 server ...") + logger.info("Requesting data from the GTS2 server ...") a_stime = time.time() api_result = Gts2Request(opts, logger=logger) a_runtime = time.time() - a_stime logger.info(">>>>>> Runtime of API: %7.2f minutes" % (a_runtime / 60.)) - if api_result["http_code"] >= 400: - logger.error("##################") - raise ChildProcessError("API call not right or server Problem (http_code={code}).".format( - code=api_result["http_code"])) if "ControlValues" in api_result and api_result["ControlValues"]["API_status"] == 1: logger.error("##################") logger.error(str(api_result["ControlValues"]["API_message"])) raise ChildProcessError("Something went wrong on GTS2 Server (http_code={code}).".format( code=api_result["http_code"])) + if api_result["http_code"] >= 400: + logger.error("##################") + raise ChildProcessError("API call not right or server Problem (http_code={code}).".format( + code=api_result["http_code"])) if only_tile != "": requ_tiles = api_result['Results'].keys() -- GitLab