fixed json decoding error, now raises APIError, and sorted IP List same as data list
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user