private static Response.Outcome toOutcome(Reply reply) {
        if (reply.getErrorCodes().contains(DocumentProtocol.ERROR_NO_SPACE)) {
            return INSUFFICIENT_STORAGE;
        }
        if (reply.getErrorCodes().contains(DocumentProtocol.ERROR_TEST_AND_SET_CONDITION_FAILED)) {
            return CONDITION_FAILED;
        }
        if (   reply instanceof UpdateDocumentReply && ! ((UpdateDocumentReply) reply).wasFound()
            || reply instanceof RemoveDocumentReply && ! ((RemoveDocumentReply) reply).wasFound()
            || reply.getErrorCodes().contains(DocumentProtocol.ERROR_DOCUMENT_NOT_FOUND)) {
            return NOT_FOUND;
        }
        if (reply.getErrorCodes().contains(DocumentProtocol.ERROR_REJECTED)) {
            return REJECTED;
        }
        if (reply.getErrorCodes().contains(ErrorCode.TIMEOUT)) {
            return TIMEOUT;
        }
        return ERROR;
    }
Returns a concatenated error string from the errors contained in a reply.

@param reply The reply whose errors to concatenate.
@return The error string.
documentapi/src/main/java/com/yahoo/documentapi/messagebus/MessageBusAsyncSession.java