Comment

Comment by notrob

> The problem is that exec does not return a non-zero return code if the command fails. Instead, it returns a rejected promise.

> While this behavior can be changed by passing ignoreReturnCode as the third argument ExecOptions, the default behavior is very surprising.

This is the same behavior as node's child process exec when wrapped by util.promisify[1] If something returns a promise (async func) it should be expected that it has the possibility of being rejected.

[1] https://nodejs.org/api/child_process.html#child_processexecc...

parent notrob 4 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton