Итак, я пытался повторить этот код:
https://github.com/sindresorhus/np/blob/370ef638344ab7115c956b75dc2823850084da39/index.js#L16
И это работает. Однако, если обещание не выполняется, я получаю предупреждение «необработанное обещание». К чему относится выражение catch к чему-то подобному, если оно вообще есть? Есть ли лучший способ получения такой информации?
(node:48454) UnhandledPromiseRejectionWarning: Error: Command failed: np patch --no-cleanup
at makeError (/Users/daghassi/git/build/node_modules/execa/index.js:172:9)
at Promise.all.then.arr (/Users/daghassi/git/build/node_modules/execa/index.js:277:16)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:160:7)
(node:48454) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 5)
(node:48454) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:48454) UnhandledPromiseRejectionWarning: Error: Command failed: np patch --no-cleanup
at makeError (/Users/daghassi/git/build/node_modules/execa/index.js:172:9)
at Promise.all.then.arr (/Users/daghassi/git/build/node_modules/execa/index.js:277:16)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:160:7)
(node:48454) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 6)
(node:48454) UnhandledPromiseRejectionWarning: Error: Command failed: np patch --no-cleanup