private final void checkOKResponseStatus()

in src/main/java/com/uber/rss/clients/ClientBase.java [286:303]


    private final void checkOKResponseStatus(int responseStatus) {
        switch (responseStatus) {
            case MessageConstants.RESPONSE_STATUS_OK:
                return;
            case MessageConstants.RESPONSE_STATUS_SHUFFLE_STAGE_NOT_STARTED:
                throw new RssShuffleStageNotStartedException(String.format("Shuffle not started: %s", connectionInfo));
            case MessageConstants.RESPONSE_STATUS_SERVER_BUSY:
                throw new RssServerBusyException(String.format("Server busy: %s", connectionInfo));
            case MessageConstants.RESPONSE_STATUS_APP_TOO_MUCH_DATA:
                throw new RssTooMuchDataException(String.format("App writing too much data: %s", connectionInfo));
            case MessageConstants.RESPONSE_STATUS_FILE_CORRUPTED:
                throw new RssFileCorruptedException(String.format("Shuffle file corrupted or application writing too much data: %s", connectionInfo));
            case MessageConstants.RESPONSE_STATUS_STALE_TASK_ATTEMPT:
                throw new RssStaleTaskAttemptException(String.format("Task attempt is stale (there is a new task retry, thus the old task is not valid any more)", responseStatus, connectionInfo));
            default:
                throw new RssNetworkException(String.format("Response not ok: %s, %s", responseStatus, connectionInfo));
        }
    }