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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
call to getInfo() might result in surprising exception being thrown #121
Comments
It was originally made that way because I compared it to how other native js functions handle bad parameters. But it does make sense, since this is an async function, to pass the error to the callback or the promise. Rather than having the user check two places. |
* Removing throw in inner call * fixing tests
I'm facing this issue on ytdl.getInfo("https://github.com").catch(error => console.log(error)); The catch block doesn't seem to catch anything and I get an error from the parent function instead |
馃帀 This issue has been resolved in version 4.3.1 馃帀 The release is available on: Your semantic-release bot 馃摝馃殌 |
Not sure if this should be fixed somehow, but thought I'd report it anyway (as a heads-up)... 馃槢
Using
getInfo()
would force you to wrap the call in a try/catch block, as the inner call togetVideoID()
might throw anError
if no id is found.Now - especially when using the promisified version - this behaviour might be surpising from a user point of view, which probably expects to grab the error in a
.catch()
statement.The text was updated successfully, but these errors were encountered: