1602 / jugglingdb

Multi-database ORM for nodejs: redis, mongodb, mysql, sqlite3, postgresql, arango, in-memory...
http://1602.github.io/jugglingdb/
2.04k stars 241 forks source link

afterX hooks called even if X errors. Is this correct/intended behavior? #360

Open 0xgeert opened 10 years ago

0xgeert commented 10 years ago

Consider a hook afterValidate . This hook will be called even if validate gives an error. Is this correct behavior? I would at least be expecting to be able to access the err object in afterValidate as a param or something, but this doesn't seem to be available.

Is this intended behavior?

1602 commented 10 years ago

It's not correct behavior. We should skip after hooks in case of error.