]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sat, 9 Mar 2024 20:16:10 +0000 (21:16 +0100)
committerRoland Häder <roland@mxchange.org>
Sat, 9 Mar 2024 20:16:10 +0000 (21:16 +0100)
- check 'json' key

fba/commands.py

index 08ff9ffeec2998bc25a73a101f15314fe7916a7d..645f149820097045aefa9528bbd040921d65347c 100644 (file)
@@ -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"]