From 3c49c0c7bd25fc5e78c81483f61cca21d4281cef Mon Sep 17 00:00:00 2001 From: ljnsn Date: Tue, 23 Jan 2024 13:55:24 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20skip=20completely=20empty?= =?UTF-8?q?=20responses?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dsws_client/parse.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dsws_client/parse.py b/dsws_client/parse.py index 6e2e31d..326caa7 100644 --- a/dsws_client/parse.py +++ b/dsws_client/parse.py @@ -67,7 +67,12 @@ def responses_to_records( """Parse a list of DSDataResponse objects into a list of records.""" parsed_response = ParsedResponse() for response in responses: - _parsed_response = parse_response(response, process_strings=process_strings) + try: + _parsed_response = parse_response(response, process_strings=process_strings) + except InvalidResponseError as exc: + logger.warning("Invalid response, skipping") + logger.debug(exc) + continue parsed_response.records.extend(_parsed_response.records) parsed_response.errors.extend(_parsed_response.errors) parsed_response.meta = parsed_response.meta.merge(_parsed_response.meta)