Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnhandledPromiseRejectionWarning: Unhandled #1

Open
anandpurushottam opened this issue May 17, 2017 · 1 comment
Open

UnhandledPromiseRejectionWarning: Unhandled #1

anandpurushottam opened this issue May 17, 2017 · 1 comment

Comments

@anandpurushottam
Copy link

anandpurushottam commented May 17, 2017

(node:6984) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: spawn .exe ENOENT
(node:6984) 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.

const jsonDump = bento4.mp4dump.exec(inputVideo, args)

Can you add a proper sample code to run commands .

@philmoss321
Copy link

Looks like the exec command returns a promise https://github.com/markusdaehn/node-fluent-bento4/blob/master/src/exec.js, so you'll need to resolve that like a normal ES6 promise...

Either use async/await (ES7/Typescript) inside of a try/catch block, they're using async await in their unit tests for the exec module
try { const jsonDump = await bento4.mp4dump.exec(inputVideo, args) catch (error) { // handle error }

Or follow up your exec call with .then and .catch
bento4.mp4dump.exec(inputVideo, args).then((data) => { // use data }).catch((error) => { // handle error )

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

No branches or pull requests

2 participants