3 ms·
Is there any typechecking library for JS that can warn of potentially "swallowed" promises? Does Flow do this?
by chatmasta 10y ago
Is there any typechecking library for JS that can warn of potentially "swallowed" promises? Does Flow do this?
- YCode 10y agoFor debugging in Node I use: process.on("unhandledRejection", err => { console.error("Uncaught Promise Error: \n" + err.stack); console.error(err); });
- mort96 10y agoThat's better than letting it get swallowed, but in my experience is pretty terrible still, as it often just results in a stack trace where your code literally doesn't exist at all. In a somewhat big project, just having a vague error message without as much as a line number is hell.
- merkaloid 10y agoeslint has rules to make you return a value on every promise, whilst Node itself will complain about unhandled promise rejection