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

UnhandledPromiseRejection on seek #89

Open
dave12311 opened this issue May 28, 2021 · 2 comments
Open

UnhandledPromiseRejection on seek #89

dave12311 opened this issue May 28, 2021 · 2 comments
Labels

Comments

@dave12311
Copy link

Bug Description

Calling the seek() function while there is no file loaded causes uncaught UnhandledPromiseRejection exception.

How To Reproduce

Create an mpv instance and call seek without loading a file first.

Expected behavior

Calling an invalid seek should reject the promise returned by the seek() function

Software Versions
  • Node-Mpv: 2
  • MPV: 0.33.1-dirty
  • OS: Linux
Additional context

Quick fix with:

observeSocket.connect({path: this.options.socket}, async () => {
    try {
        await this.command('seek', [seconds, mode, 'exact']);
    } catch (e) {
        reject(e);
    }
})
@dave12311 dave12311 added the bug label May 28, 2021
@j-holub
Copy link
Owner

j-holub commented Jun 1, 2021

Hey there,

I'm sorry for only seeing this just now, Thanks for noticing, this is indeed something that shouldn't happen, as it's so simple. If you want to, you can make a PR or I can make the fix, up to you : )

Cheers

@husudosu
Copy link

husudosu commented Jul 4, 2022

If it's okay I'm gonna do the PR request. It's been a year since the issue opened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants