You've already forked RadioPlayer
mirror of
https://github.com/radio95-rnt/RadioPlayer.git
synced 2026-02-26 21:53:54 +01:00
fix
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user