Skip to content

Commit

Permalink
Show WebAPI system warning message.
Browse files Browse the repository at this point in the history
  • Loading branch information
wei committed Nov 18, 2024
1 parent 88fd3a7 commit 6507b25
Show file tree
Hide file tree
Showing 2 changed files with 439 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tidy3d/web/core/http_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
)
from .environment import Env
from .exceptions import WebError
from .log import get_logging_console

REINITIALIZED = False

Expand Down Expand Up @@ -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
Expand Down
Loading

0 comments on commit 6507b25

Please sign in to comment.