From: Roland Häder Date: Sat, 9 Mar 2024 20:16:10 +0000 (+0100) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3c6be18d6e2ba77a00f679ebcbb95d69c75e4dd2;p=fba.git Continued: - check 'json' key --- diff --git a/fba/commands.py b/fba/commands.py index 08ff9ff..645f149 100644 --- a/fba/commands.py +++ b/fba/commands.py @@ -205,9 +205,12 @@ def fetch_bkali(args: argparse.Namespace) -> int: if "error_message" in fetched: logger.warning("post_json_api() for 'gql.sources.bka.li' returned error message='%s' - EXIT!", fetched["error_message"]) return 100 + elif "json" not in fetched: + logger.warning("post_json_api() returned fetched[]='%s' with missing 'json' element - EXIT!", type(fetched)) + return 101 elif isinstance(fetched["json"], dict) and "error" in fetched["json"] and "message" in fetched["json"]["error"]: logger.warning("post_json_api() returned error: '%s' - EXIT!", fetched["json"]["error"]["message"]) - return 101 + return 102 rows = fetched["json"]