Beispiel #1
0
def check_response_error(*, status: int, data: Any) -> None:
    if status >= 400:
        errors.raise_exception(data, status)
    if not isinstance(data, dict):
        return
    data_status = data.get("status", None)
    if data_status is None:
        return
    if data_status == constants.STATUS_SUCCESS:
        return
    errors.raise_exception(data, status)
Beispiel #2
0
def check_response_error(status: int, data: Any) -> None:
    if status >= 400:
        errors.raise_exception(data, status)
Beispiel #3
0
 def _check_response_error(self, status: int, data: Any):
     if "status" in data and data["status"] != 0:
         errors.raise_exception(data, status)
     if status >= 400 and "value" in data and "error" in data["value"]:
         errors.raise_exception(data, status)
Beispiel #4
0
 def _check_response_error(self, status: int, data: Any):
     if 'status' in data and data['status'] != 0:
         errors.raise_exception(data, status)