News for hackers. Stuff that matters.
Re:Node v6.9.0 (LTS) by WorldMaker on Tuesday October 18, 2016 @03:55PM (#12738080)
I disagree. Developers are human and if they have to remember to write extra code to get a thing to do the right thing, they are likely to forget. (try-except-pass is an explicit opt out; if (err) throw err is a "required" opt in.)

This "bug" in some of the Promise runtimes could just as easily be handled by forcing every Promise chain to end in a .catch((err) => /* ... */). Requiring even this little bit is less onerous than node-style callbacks where every "link in the chain" needs explicit opt-in, with Promises you only "have to" opt in and deal with boundaries, just like try-catch in most languages.

Yes, it's not great that Node and some of the browsers initially "missed" the "great try/catch in the sky" catch all logging, but again that is easily resolved at the runtime platform level whereas node can't possibly tell you if a developer missed an if (err) throw err somewhere in a callback chain 10-levels deep and across three or four dependencies.

Re:Node v6.9.0 (LTS) by nilliams on Tuesday October 18, 2016 @04:08PM (#12738181)
I agree that handling promises should be by default better than remembering to 'if (err) throw err' but my original comment was about how spec-adhering promise polyfills like es6-promise are basically broken because they silently swallow the most egregious errors.

They silently swallow all runtime exceptions, not 'error from reading said file you told me to read, that there should, by any sane degree be SOME KIND of error handling for, and for anyone serious about programming in a dynamic language, also test coverage for'.

Those two things are different issues, on different levels.

> Yes, it's not great that Node and some of the browsers initially "missed" the "great try/catch in the sky" catch all logging, but again that is easily resolved at the runtime platform level

That's all my original comment said. The platforms (actually the spec) failed to get it right initially, the implementation was broken and now it is fixed.

Re:Node v6.9.0 (LTS) by dkoston on Tuesday October 18, 2016 @05:57PM (#12739100)
Seriously? It takes 5 seconds to add an eslint rule to avoid this issue.

http://eslint.org/docs/rules/handle-callback-err

Re:Node v6.9.0 (LTS) by WorldMaker on Wednesday October 19, 2016 @10:35AM (#12744133)
The time this bit me the most the error was swallowed in a dependency of a dependency of a gulp plugin. Do you also eslint node_modules//*.js?
Re:Node v6.9.0 (LTS) by minitech on Tuesday October 18, 2016 @08:15PM (#12739880)
In my experience, it has too many false positives to turn on.
Re:Node v6.9.0 (LTS) by dkoston on Wednesday October 19, 2016 @09:29AM (#12743561)
Sorry to hear about your experience. Been using it for years as part of our build processes with no false positives.

You're always welcome to write a replacement if you find it unsuitable.

Re:Node v6.9.0 (LTS) by minitech on Wednesday October 19, 2016 @04:18PM (#12747328)
I don’t need a replacement, just offering an explanation for why some people’s needs might not be satisfied by this rule.