Exemplo n.º 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)
Exemplo n.º 2
0
def check_response_error(status: int, data: Any) -> None:
    if status >= 400:
        errors.raise_exception(data, status)
Exemplo n.º 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)
Exemplo n.º 4
0
 def _check_response_error(self, status: int, data: Any):
     if 'status' in data and data['status'] != 0:
         errors.raise_exception(data, status)