mongoose-lifecycle icon indicating copy to clipboard operation
mongoose-lifecycle copied to clipboard

Feature Request: Check hook return values for error or provide next to hooks

Open aheyer opened this issue 11 years ago • 3 comments

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.

aheyer avatar Jun 11 '14 13:06 aheyer

+1 Please Implement

chrisgco avatar Feb 01 '15 01:02 chrisgco

+1

aklinkert avatar Aug 31 '15 19:08 aklinkert

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

jorgecuesta avatar Dec 08 '15 16:12 jorgecuesta