From: Okhin Date: Sat, 24 Mar 2018 19:11:37 +0000 (+0100) Subject: Replacing the err being thrown by a gracefull exit.process(1) X-Git-Tag: v1.0.0-beta.2~41 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=f5b611f9ee8b6cb6236cf01c4963eb01bdadb7c9;p=github%2FChocobozzz%2FPeerTube.git Replacing the err being thrown by a gracefull exit.process(1) --- diff --git a/server/tools/import-videos.ts b/server/tools/import-videos.ts index 433cee652..72223a01a 100644 --- a/server/tools/import-videos.ts +++ b/server/tools/import-videos.ts @@ -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); } }