From: Roland Häder Date: Tue, 12 Dec 2023 02:34:16 +0000 (+0100) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=638f469016ce0283cc5ec2d584566e3c50710e7b;p=fba.git Continued: - added "error_message" JSON error message --- diff --git a/fba/models/instances.py b/fba/models/instances.py index ab9995f..a83e99d 100644 --- a/fba/models/instances.py +++ b/fba/models/instances.py @@ -280,6 +280,10 @@ def set_last_error(domain: str, error: dict): logger.debug("Setting last_error_details='%s' (json,error)", error["json"]["msg"]) _set_data("last_status_code" , domain, error["status_code"]) _set_data("last_error_details", domain, error["json"]["msg"] if error["json"]["msg"] != "" else None) + elif "json" in error and "error" in error["json"] and "error_message" in error["json"]: + logger.debug("Setting last_error_details='%s' (json,error)", error["json"]["error_message"]) + _set_data("last_status_code" , domain, error["status_code"]) + _set_data("last_error_details", domain, error["json"]["error_message"] if error["json"]["error_message"] != "" else None) elif "json" in error and "error" in error["json"] and "message" in error["json"]["error"]: logger.debug("Setting last_error_details='%s' (json,error)", error["json"]["error"]["message"]) _set_data("last_status_code" , domain, error["status_code"])