🎨return_code 未找到情况下返回解析的数据

This commit is contained in:
洛水居室 2022-10-08 09:07:07 +08:00
parent 1c33189752
commit cd28ef9120
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC

View File

@ -2,7 +2,7 @@ from typing import Union
import httpx import httpx
from modules.apihelper.error import NetworkException, ResponseException, DataNotFoundError, TimedOut from modules.apihelper.error import NetworkException, ResponseException, TimedOut
from modules.apihelper.request.httpxrequest import HTTPXRequest from modules.apihelper.request.httpxrequest import HTTPXRequest
from modules.apihelper.typedefs import POST_DATA, JSON_DATA from modules.apihelper.typedefs import POST_DATA, JSON_DATA
@ -26,8 +26,6 @@ class HOYORequest(HTTPXRequest):
data = json_data.get("data", None) data = json_data.get("data", None)
message = json_data.get("message", None) message = json_data.get("message", None)
if return_code is None: if return_code is None:
if data is None:
raise DataNotFoundError
return json_data return json_data
if return_code != 0: if return_code != 0:
if message is None: if message is None: