News for hackers. Stuff that matters.
Re:What’s New in ES2019 by iraldir on Tuesday July 30, 2019 @06:47AM (#20563604)
It does, though I wouldn't go to the same conclusion. It gives more freedom to the developer. They are lot of cases where errors are in fact, expected. Parsing a user inputted JSON. Making a request to check internet connection availability. Any promise that is going to be consumed by an async - await pattern. In those cases (and many more), you may want to try something just simply to see if it works. It's completely different say to being on the backend, trying to write to a database which may or may not fail.

In those cases, forcing the extra parameter in the catch, even though you are not using it, is slightly annoying. I mean it's literally 3 characters, but in this age of linters encouraging to not specify arguments you don't use, it just feels unnatural.

Re:What’s New in ES2019 by ShinTakuya on Tuesday July 30, 2019 @09:59AM (#20564894)
The problem is that the catch block will catch all errors, so if a different type of error to the one you expected occurs then it gets silently swallowed. This is the equivalent of catching the generic Exception class in python. Horrendous terrible practice in anything but the hackiest scripts.
Re:What’s New in ES2019 by h1d on Thursday August 01, 2019 @10:11AM (#20583791)
Why would you ever want to ignore the error parameter?

I really hate when a system tells me "Unknown error occured" or "Either this or that happened" because the software doesn't care to be specific with the errors.

You should at least log the error message, not ignore it.