public void AddMigrationError(MigrationVersion version, DocumentMigrationError documentMigrationError) {
            var d = new Dictionary<string, object> {
                { "DocumentId", new BsonString(documentMigrationError.DocumentId) },
                { "Error", new BsonString(documentMigrationError.Error) }
            };

            GetMigrationsCollection().Update(Query.EQ("_id", new BsonString(version.ToString())), Update.Push("FailedMigrations", new BsonDocument(d)));
        }
        public void AddMigrationError(MigrationVersion version, DocumentMigrationError documentMigrationError)
        {
            var d = new Dictionary <string, object> {
                { "DocumentId", new BsonString(documentMigrationError.DocumentId) },
                { "Error", new BsonString(documentMigrationError.Error) }
            };

            GetMigrationsCollection().Update(Query.EQ("_id", new BsonString(version.ToString())), Update.Push("FailedMigrations", new BsonDocument(d)));
        }
Пример #3
0
        protected virtual void OnErrorUpdatingDocument(BsonDocument document, Exception exception) {
            var error = new DocumentMigrationError(document.GetDocumentId().ToString(), exception.ToString());
            if (MigrationErrorCallback != null)
                MigrationErrorCallback(this, error);

            string message = String.Format("Failed updating document \"{0}\" in \"{1}\" for migration \"{2}\" for version {3} to database \"{4}\": {5}",
                document.GetDocumentId(), CollectionName, Description, Version, Database.Name, exception.Message);
            Trace.TraceError(message);
        }
        protected virtual void OnErrorUpdatingDocument(BsonDocument document, Exception exception)
        {
            var error = new DocumentMigrationError(document.GetDocumentId().ToString(), exception.ToString());

            if (MigrationErrorCallback != null)
            {
                MigrationErrorCallback(this, error);
            }

            string message = String.Format("Failed updating document \"{0}\" in \"{1}\" for migration \"{2}\" for version {3} to database \"{4}\": {5}",
                                           document.GetDocumentId(), CollectionName, Description, Version, Database.Name, exception.Message);

            Trace.TraceError(message);
        }
Пример #5
0
 private void MigrationErrorCallback(Migration migration, DocumentMigrationError documentMigrationError)
 {
     DatabaseStatus.AddMigrationError(migration.Version, documentMigrationError);
 }
Пример #6
0
 private void MigrationErrorCallback(Migration migration, DocumentMigrationError documentMigrationError) {
     DatabaseStatus.AddMigrationError(migration.Version, documentMigrationError);
 }