From: Chocobozzz Date: Tue, 14 Apr 2020 07:41:20 +0000 (+0200) Subject: Catch error in import script X-Git-Tag: v2.2.0-rc.1~233 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f940e81469928009e04b72866abba0d5845770d9;p=oweals%2Fpeertube.git Catch error in import script --- diff --git a/server/tools/peertube-import-videos.ts b/server/tools/peertube-import-videos.ts index 7f3b58bba..2c9eabe98 100644 --- a/server/tools/peertube-import-videos.ts +++ b/server/tools/peertube-import-videos.ts @@ -93,12 +93,16 @@ async function run (url: string, user: UserInfo) { log.info('Will download and upload %d videos.\n', infoArray.length) for (const info of infoArray) { - await processVideo({ - cwd: program['tmpdir'], - url, - user, - youtubeInfo: info - }) + try { + await processVideo({ + cwd: program['tmpdir'], + url, + user, + youtubeInfo: info + }) + } catch (err) { + console.error('Cannot process video.', { info, url }) + } } log.info('Video/s for user %s imported: %s', user.username, program['targetUrl'])