MCPcopy
hub / github.com/AstrBotDevs/AstrBot / _service_error

Function _service_error

astrbot/dashboard/api/updates.py:60–74  ·  view source on GitHub ↗
(exc: UpdateServiceError)

Source from the content-addressed store, hash-verified

58
59
60def _service_error(exc: UpdateServiceError) -> JSONResponse:
61 logger.error(f"Dashboard update operation failed: {exc}", exc_info=True)
62 if exc.code == "desktop_managed":
63 return JSONResponse(
64 {
65 "status": "error",
66 "message": DESKTOP_MANAGED_RESTART_MESSAGE,
67 "data": None,
68 },
69 status_code=200,
70 )
71 return JSONResponse(
72 {"status": "error", "message": "An internal error has occurred.", "data": None},
73 status_code=200,
74 )
75
76
77async def _run(operation) -> JSONResponse:

Callers 1

_runFunction · 0.70

Calls 1

errorMethod · 0.45

Tested by

no test coverage detected