fixed json decoding error, now raises APIError, and sorted IP List same as data list

This commit is contained in:
UpstreamData
2021-10-26 11:40:17 -06:00
parent f4500b88ac
commit edbd1bbe94
2 changed files with 8 additions and 1 deletions

View File

@@ -71,7 +71,10 @@ class BaseMinerAPI:
except Exception as e:
print(e)
data = json.loads(data.decode('utf-8')[:-1])
try:
data = json.loads(data.decode('utf-8')[:-1])
except json.decoder.JSONDecodeError:
raise APIError(f"Decode Error: {data}")
# close the connection
writer.close()