News for hackers. Stuff that matters.
Re:After a year of using Node.js in production by lucaspiller on Monday May 02, 2016 @05:35PM (#11615873)
Kind of related: One thing that has bit me a few times with promises is accidentally missing a return in the promise body. As such whatever called the promise just sits there forever, waiting for something that will never come. Is there a way in Bluebird to have it throw an exception or similar if the function executes without returning anything?
Re:After a year of using Node.js in production by spion on Monday May 02, 2016 @05:38PM (#11615898)
Normally bluebird should produce this warning when that happens:

http://bluebirdjs.com/docs/warning-explanations.html#warning...

If it doesn't do that for your case then its likely that it needs some fixing - you should probably open an issue and we'll try to reproduce it...

Also, thenlint might work for you: https://www.npmjs.com/package/thenlint

Re:After a year of using Node.js in production by Touche on Monday May 02, 2016 @06:02PM (#11616069)
I sort of don't understand your problem. If you forget to return a value won't the thing consuming the Promise just get undefined as the value (and perhaps throws an exception expecting the value to be something other than undefined)?