0
1
mirror of https://github.com/radio95-rnt/RadioPlayer.git synced 2026-02-26 21:53:54 +01:00
This commit is contained in:
2025-12-06 22:00:25 +01:00
parent c8bd49ef1b
commit eb471c663a

View File

@@ -33,9 +33,9 @@ class APIHandler(BaseHTTPRequestHandler):
time.sleep(0.05) # Wait briefly to avoid a busy loop
if response_json:
try:
rdata = json.loads(response_json)
if "error" in rdata: code = 500 # Server error if module reported one
except (json.JSONDecodeError, TypeError):
rdata = response_json
if "error" in repr(rdata): code = 500 # Server error if module reported one
except TypeError:
rdata = {"error": "Invalid data format from module"}
code = 500
else: