mongoose-lifecycle
mongoose-lifecycle copied to clipboard
Feature Request: Check hook return values for error or provide next to hooks
At the moment you have to throw if a hook encounters an error. This bypasses Mongoose's next middleware mechanism and can break your server. So please provide access to the next CB in the hook functions or check return values for Error objects.
I'd like to see the hook invocation with this set to the model instance instead of providing the model as parameter, too.
+1 Please Implement
+1
Hi, I create a pull request to prevent errors dead server or leave it frozen without throw and error. https://github.com/fzaninotto/mongoose-lifecycle/pull/4