From 4078097218f7066d1c1ed19ece25ee4a37cb578d Mon Sep 17 00:00:00 2001 From: wei Date: Mon, 18 Nov 2024 14:21:42 +0800 Subject: [PATCH] Show WebAPI system warning message. --- tidy3d/web/core/http_util.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tidy3d/web/core/http_util.py b/tidy3d/web/core/http_util.py index 986ef5de5..d5100f1c7 100644 --- a/tidy3d/web/core/http_util.py +++ b/tidy3d/web/core/http_util.py @@ -25,6 +25,7 @@ ) from .environment import Env from .exceptions import WebError +from .log import get_logging_console REINITIALIZED = False @@ -139,6 +140,11 @@ def wrapper(*args, **kwargs): if not resp.text: return None result = resp.json() + warning = result.get("warning") + if warning: + console = get_logging_console() + console.log(f"Warning: {warning}") + return result.get("data") if "data" in result else result return wrapper