Show a warning when an action raises an Exception

This commit is contained in:
ChaoticByte 2025-02-28 15:09:07 +01:00
parent c74ee7c6cb
commit ecde43a0a3
No known key found for this signature in database

View file

@ -12,6 +12,8 @@ from typing import List
import requests, urllib3
from nicegui import ui
from .mixins import PingableMixin, WakeOnLanMixin
@ -31,7 +33,11 @@ class Action:
self.kwargs = kwargs
def __call__(self):
try:
self.c(*self.args, **self.kwargs)
except Exception as e:
ui.notify(f"Exception: {e.__str__()}", close_button=True, type="warning", timeout=0, multi_line=True)
raise e
class SystemState(Enum):