mirror of https://github.com/Chocobozzz/PeerTube
Replacing the err being thrown by a gracefull exit.process(1)
parent
b32b782718
commit
f5b611f9ee
|
@ -53,7 +53,10 @@ async function run () {
|
||||||
|
|
||||||
const options = [ '-j', '--flat-playlist', '--playlist-reverse' ]
|
const options = [ '-j', '--flat-playlist', '--playlist-reverse' ]
|
||||||
youtubeDL.getInfo(program['targetUrl'], options, processOptions, async (err, info) => {
|
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[]
|
let infoArray: any[]
|
||||||
|
|
||||||
|
@ -157,7 +160,8 @@ async function uploadVideoOnPeerTube (videoInfo: any, videoPath: string, languag
|
||||||
|
|
||||||
await uploadVideo(program['url'], accessToken, videoAttributes)
|
await uploadVideo(program['url'], accessToken, videoAttributes)
|
||||||
} else {
|
} else {
|
||||||
throw err
|
console.log(err.message);
|
||||||
|
process.exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue