sources: fail gracefully when a source returns invalid JSON
Include the actual output of the source to help debugging.
This commit is contained in:
parent
ef7f17d95b
commit
02ad4e3810
1 changed files with 4 additions and 1 deletions
|
|
@ -26,7 +26,10 @@ class SourcesServer:
|
|||
encoding="utf-8",
|
||||
check=False)
|
||||
|
||||
return json.loads(r.stdout)
|
||||
try:
|
||||
return json.loads(r.stdout)
|
||||
except ValueError:
|
||||
return {"error": f"source returned malformed json: {r.stdout}"}
|
||||
|
||||
def _dispatch(self, sock):
|
||||
msg, addr = sock.recvfrom(8182)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue