3 ms·
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 j
by lucaspiller 11y ago
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?
- spion 11y agoNormally bluebird should produce this warning when that happens: http://bluebirdjs.com/docs/warning-explanations.html#warning-a-promise-was-created-in-a-handler-but-none-were-returned-from-it 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 https://www.npmjs.com/package/thenlint
- Touche 10y agoI 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)?