bug: fix the v2.0.4 whatsminer error codes bug to work with new versions where it was fixed.

This commit is contained in:
Upstream Data
2022-11-01 22:15:13 -06:00
parent aa0a028564
commit 5ff10c0cdd

View File

@@ -164,6 +164,14 @@ class BTMiner(BaseMiner):
if err_data.get("Msg"):
if err_data["Msg"].get("error_code"):
for err in err_data["Msg"]["error_code"]:
if isinstance(err, dict):
for code in err:
data.append(
WhatsminerError(
error_code=int(code)
)
)
else:
data.append(
WhatsminerError(
error_code=int(err)
@@ -350,6 +358,14 @@ class BTMiner(BaseMiner):
if err_data.get("Msg"):
if err_data["Msg"].get("error_code"):
for err in err_data["Msg"]["error_code"]:
if isinstance(err, dict):
for code in err:
data.errors.append(
WhatsminerError(
error_code=int(code)
)
)
else:
data.errors.append(
WhatsminerError(
error_code=int(err)