Closed zwhitchcox closed 6 years ago
So, here's some actual code from my project. As you can see, I'm having to check for the stderr and still catch errors, when I'd rather just do that in one place.
7 it('should import all functions when line is specified', () =>
8 exec('js-import', ['react']).then(([stdout, stderr]) => {
9 if (stderr) console.error(stderr)
10 })
11 .catch(console.error)
12 )
So, Node has deprecated promises without a catch statement. The error message is kind of annoying, and it'd be nice to have all my code the same way. Can we, instead of the
[stdout, stderr]
implementation instead just use thecatch
syntax? It would be much nicer for me, and then I don't have to do.catch(console.error)
for no reason.Anyway, thanks for creating this!