From bbc901b192e55150fbb3c901cd8eaf24f57bb610 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 29 Sep 2024 06:11:32 +0200 Subject: [PATCH] Continued: - added debug lines for function invocation - change INFO into DEBUG message - changed type to "any" (maybe it is limitable?) --- fba/http/network.py | 6 +++++- fba/models/instances.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/fba/http/network.py b/fba/http/network.py index e95ef6a..ec020c3 100644 --- a/fba/http/network.py +++ b/fba/http/network.py @@ -118,6 +118,8 @@ def post_json_api(domain: str, path: str, data: str = "", headers: dict = dict() json_reply["status_code"] = 999 json_reply["error_message"] = f"exception['{type(exception)}']='{str(exception)}'" json_reply["exception"] = exception + + logger.debug("Invoking instances.set_last_error(%s,%s) ...", domain, exception) instances.set_last_error(domain, exception) raise exception @@ -194,6 +196,8 @@ def get_json_api(domain: str, path: str, headers: dict, timeout: tuple) -> dict: json_reply["status_code"] = 999 json_reply["error_message"] = f"exception['{type(exception)}']='{str(exception)}'" json_reply["exception"] = exception + + logger.debug("Invoking instances.set_last_error(%s,%s) ...", domain, exception) instances.set_last_error(domain, exception) raise exception @@ -379,7 +383,7 @@ def fetch_json_rows(hostname: str, path: str, headers: dict = {}, rows_key: str elif rows_key is not None and rows_key == "": raise ValueError("Parameter 'rows_key' is an empty string") - logger.info("Fetching list from hostname='%s',path='%s' ...", hostname, path) + logger.debug("Invoking get_json_api(%s,%s,headers()=%d) ...", hostname, path, len(headers)) fetched = get_json_api( hostname, path, diff --git a/fba/models/instances.py b/fba/models/instances.py index 5ea702f..7de40c6 100644 --- a/fba/models/instances.py +++ b/fba/models/instances.py @@ -253,7 +253,7 @@ def set_last_nodeinfo(domain: str) -> None: logger.debug("EXIT!") -def set_last_error(domain: str, error: dict) -> None: +def set_last_error(domain: str, error: any) -> None: logger.debug("domain='%s',error[]='%s' - CALLED!", domain, type(error)) domain_helper.raise_on(domain) -- 2.39.5