def _query_raise_for_status(self, resp: httpx.Response) -> None:
        """
        Query API specific raise for status method.
        If multiple errors:
            If all errors are timeout, raise VespaTimeoutError (504).
            If even one error is not timeout, raise VespaStatusError (500).
        """
        # See error codes here https://github.com/vespa-engine/vespa/blob/master/container-core/src/main/java/com/yahoo/container/protect/Error.java
        try:
            resp.raise_for_status()
        except httpx.HTTPStatusError as e:
            try:
                result = QueryResult(**resp.json())
                if (
                        result.root.errors is not None
                        and len(result.root.errors) > 0
                ):
                    for error in result.root.errors:
                        if not self._is_timeout_error(error, resp):
                            # Raise 500 if any error is not timeout
                            raise VespaStatusError(message=resp.text, cause=e) from e
                    # Raise 504 if all errors are timeout
                    raise VespaTimeoutError(message=resp.text, cause=e) from e
                raise e
            except VespaStatusError:
                raise
            except Exception:
                raise VespaStatusError(message=resp.text, cause=e) from e

        Query API specific raise for status method.
        If multiple errors:
            If all errors are timeout, raise VespaTimeoutError (504).
            If even one error is not timeout, raise VespaStatusError (500).
        
src/marqo/vespa/vespa_client.py