Skip to content

Commit

Permalink
Merge pull request #34 from pierreminiggio/tell-user-that-he-forgot-t…
Browse files Browse the repository at this point in the history
…o-set-visibility

Tell the package user that he forgot to set visibility, and close browser
  • Loading branch information
fawazahmed0 committed Aug 27, 2021
2 parents dcfbedc + 6f68b0d commit eb80948
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,12 @@ async function uploadVideo (videoJSON) {
}
// await page.waitForXPath('//*[contains(text(),"Finished processing")]', { timeout: 0})
// Wait for closebtn to show up
await page.waitForXPath(closeBtnXPath)
try {
await page.waitForXPath(closeBtnXPath)
} catch (e) {
await browser.close()
throw new Error('Please make sure you set up your default video visibility correctly, you might have forgotten. More infos : https://github.com/fawazahmed0/youtube-uploader#youtube-setup');
}

return uploadedLink
}

0 comments on commit eb80948

Please sign in to comment.