From 638f469016ce0283cc5ec2d584566e3c50710e7b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 12 Dec 2023 03:34:16 +0100 Subject: [PATCH] Continued: - added "error_message" JSON error message --- fba/models/instances.py | 4 ++++ 1 file changed, 4 insertions(+) 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"]) -- 2.39.5