]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Replacing the err being thrown by a gracefull exit.process(1)
authorOkhin <okhin@okhin.fr>
Sat, 24 Mar 2018 19:11:37 +0000 (20:11 +0100)
committerRigel Kent <par@rigelk.eu>
Sat, 24 Mar 2018 20:17:29 +0000 (21:17 +0100)
server/tools/import-videos.ts

index 433cee6525e06971ba19a64d28def7afd2cff1f2..72223a01a288d0916da3dacc1378cc3dd6cf6f1d 100644 (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);
     }
   }