Skip to content

Actually return promise in Comb::processFile#643

Open
Holzhaus wants to merge 1 commit intocsscomb:devfrom
Holzhaus:unhandled-promise-rejection
Open

Actually return promise in Comb::processFile#643
Holzhaus wants to merge 1 commit intocsscomb:devfrom
Holzhaus:unhandled-promise-rejection

Conversation

@Holzhaus
Copy link

This makes it possible to catch exceptions in processFiles in
cli.js. Without this, node raises an error when promise throws an
exception:

node:internal/process/promises:245
          triggerUncaughtException(err, true /* fromPromise */);
          ^

[UnhandledPromiseRejection: 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(). The promise rejected with the reason "[object Object]".] {
  code: 'ERR_UNHANDLED_REJECTION'
}

This makes it possible to catch exceptions in `processFiles` in
`cli.js`. Without this, node raises an error when promise throws an
exception:

    node:internal/process/promises:245
              triggerUncaughtException(err, true /* fromPromise */);
              ^

    [UnhandledPromiseRejection: 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(). The promise rejected with the reason "[object Object]".] {
      code: 'ERR_UNHANDLED_REJECTION'
    }
@Holzhaus
Copy link
Author

Ping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant