fix: improve error handling when reading app state in HTTP handler
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
parent
009b8016bb
commit
acff082d09
1 changed files with 3 additions and 2 deletions
|
|
@ -554,9 +554,10 @@ class Handler(BaseHTTPRequestHandler):
|
||||||
return
|
return
|
||||||
|
|
||||||
app, err = read_app_info(name)
|
app, err = read_app_info(name)
|
||||||
if err is not None:
|
if err is not None or app is None:
|
||||||
run_panelctl(["remove", name])
|
run_panelctl(["remove", name])
|
||||||
self._json(500, {"ok": False, "error": f"failed to read app state: {err.get('error', 'unknown error')}"})
|
err_msg = (err or {}).get("error", "unknown error") if err else "app state unavailable"
|
||||||
|
self._json(500, {"ok": False, "error": f"failed to read app state: {err_msg}"})
|
||||||
return
|
return
|
||||||
|
|
||||||
if source_type == "raw":
|
if source_type == "raw":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue