예제 #1
0
        private void CollectError(string documentId, string errorString)
        {
            var docIdToUpdateDescriptor = docIdToUpdateDescriptorMap[documentId];
            var operation = docIdToUpdateDescriptor.Operation.ToString().ToLower();

            var error = new CouchError(serializer, errorString);

            if (error.IsConflict)
            {
                exceptions.Add(error.CreateStaleStateException(operation, documentId, docIdToUpdateDescriptor.DocumentRevision));
            }
            else if (error.IsForbidden)
            {
                exceptions.Add(error.CreateInvalidDocumentException(documentId));
            }
            else
            {
                exceptions.Add(error.CreateCouchCommunicationException());
            }
        }
예제 #2
0
        private void CollectError(string documentId, string errorString)
        {
            var docIdToUpdateDescriptor = docIdToUpdateDescriptorMap[documentId];
            var operation = docIdToUpdateDescriptor.Operation.ToString().ToLower();

            var error = new CouchError(serializer, errorString);

            if (error.IsConflict)
                exceptions.Add(error.CreateStaleStateException(operation, documentId, docIdToUpdateDescriptor.DocumentRevision));
            else if (error.IsForbidden)
                exceptions.Add(error.CreateInvalidDocumentException(documentId));
            else
                exceptions.Add(error.CreateCouchCommunicationException());
        }