mirror of
https://github.com/tiqi-group/pydase.git
synced 2026-02-14 06:18:41 +01:00
feat: added frontend exception notifications
This commit is contained in:
@@ -396,15 +396,18 @@ class Server:
|
||||
if self._enable_web:
|
||||
|
||||
async def emit_exception() -> None:
|
||||
await self._wapi.sio.emit( # type: ignore
|
||||
"exception",
|
||||
{
|
||||
"data": {
|
||||
"exception": str(exc),
|
||||
"type": exc.__class__.__name__,
|
||||
}
|
||||
},
|
||||
)
|
||||
try:
|
||||
await self._wapi.sio.emit( # type: ignore
|
||||
"exception",
|
||||
{
|
||||
"data": {
|
||||
"exception": str(exc),
|
||||
"type": exc.__class__.__name__,
|
||||
}
|
||||
},
|
||||
)
|
||||
except Exception as e:
|
||||
logger.warning(f"Failed to send notification: {e}")
|
||||
|
||||
loop.create_task(emit_exception())
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user