1
0
Fork 0

Replacing the err being thrown by a gracefull exit.process(1)

This commit is contained in:
Okhin 2018-03-24 20:11:37 +01:00 committed by Rigel Kent
parent b32b782718
commit f5b611f9ee

View file

@ -53,7 +53,10 @@ async function run () {
const options = [ '-j', '--flat-playlist', '--playlist-reverse' ]
youtubeDL.getInfo(program['targetUrl'], options, processOptions, async (err, info) => {
if (err) throw err
if (err) {
console.log(err.message);
process.exit(1);
}
let infoArray: any[]
@ -157,7 +160,8 @@ async function uploadVideoOnPeerTube (videoInfo: any, videoPath: string, languag
await uploadVideo(program['url'], accessToken, videoAttributes)
} else {
throw err
console.log(err.message);
process.exit(1);
}
}