jamescarr/mongoosastic — pull request #99 by xren (2014-04-17 18:23:21+00:00)
Title: Emit the error when doc.save() fails during synchronization

During the synchronization, when ```doc.save()``` fails, it basically stuck, without any error message. This PR help catching the error when ```doc.save()``` fails during synchronization. It usually happens when schema update causes existing doc fails on pre-save validation.

For example, ```Schema({ name: { type: String } });``` being updated to ```Schema({ name: { type: String, required: true } });``` without proper db migration will cause existing doc without name field failing to be saved.