Better HN
topnewbestaskshowjobs
Log inSign up

notrob

12 karma · joined Sep 26, 2022 (4y ago) · 4 submissions

Submissions

1.

Have a Question? Ask Jev(askjev.net ↗)

3 points · by notrob · 2mo ago · discuss

2.

Show HN: Snips.sh – passwordless, anonymous SSH-powered pastebin(snips.sh ↗)

8 points · by notrob · 3y ago · 1 comment

3.

Show HN: Roastedby.ai – Talk some trash, have some fun(roastedby.ai ↗)

46 points · by notrob · 3y ago · 53 comments

comment 4y ago · link · parent

> 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...