diff options
author | Okhin <okhin@okhin.fr> | 2018-03-24 20:11:37 +0100 |
---|---|---|
committer | Rigel Kent <par@rigelk.eu> | 2018-03-24 21:17:29 +0100 |
commit | f5b611f9ee8b6cb6236cf01c4963eb01bdadb7c9 (patch) | |
tree | a824161effaf2c33fdf75d8f32fef2b74f9efca0 /server/tools | |
parent | b32b78271856ee12fdce5fadc7ed0fe81ecaeff5 (diff) | |
download | PeerTube-f5b611f9ee8b6cb6236cf01c4963eb01bdadb7c9.tar.gz PeerTube-f5b611f9ee8b6cb6236cf01c4963eb01bdadb7c9.tar.zst PeerTube-f5b611f9ee8b6cb6236cf01c4963eb01bdadb7c9.zip |
Replacing the err being thrown by a gracefull exit.process(1)
Diffstat (limited to 'server/tools')
-rw-r--r-- | server/tools/import-videos.ts | 8 |
1 files changed, 6 insertions, 2 deletions
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 () { | |||
53 | 53 | ||
54 | const options = [ '-j', '--flat-playlist', '--playlist-reverse' ] | 54 | const options = [ '-j', '--flat-playlist', '--playlist-reverse' ] |
55 | youtubeDL.getInfo(program['targetUrl'], options, processOptions, async (err, info) => { | 55 | youtubeDL.getInfo(program['targetUrl'], options, processOptions, async (err, info) => { |
56 | if (err) throw err | 56 | if (err) { |
57 | console.log(err.message); | ||
58 | process.exit(1); | ||
59 | } | ||
57 | 60 | ||
58 | let infoArray: any[] | 61 | let infoArray: any[] |
59 | 62 | ||
@@ -157,7 +160,8 @@ async function uploadVideoOnPeerTube (videoInfo: any, videoPath: string, languag | |||
157 | 160 | ||
158 | await uploadVideo(program['url'], accessToken, videoAttributes) | 161 | await uploadVideo(program['url'], accessToken, videoAttributes) |
159 | } else { | 162 | } else { |
160 | throw err | 163 | console.log(err.message); |
164 | process.exit(1); | ||
161 | } | 165 | } |
162 | } | 166 | } |
163 | 167 | ||