From: Chocobozzz Date: Mon, 17 Sep 2018 15:50:51 +0000 (+0200) Subject: Improve webtorrent import error message when the torrent has multiple X-Git-Tag: v1.0.0-beta.14~58 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=dae4a1c0f8d8af2528d7e04fef2b8b65b2d52122;p=github%2FChocobozzz%2FPeerTube.git Improve webtorrent import error message when the torrent has multiple files --- diff --git a/server/helpers/webtorrent.ts b/server/helpers/webtorrent.ts index 2fdfd1876..f4b44bc4f 100644 --- a/server/helpers/webtorrent.ts +++ b/server/helpers/webtorrent.ts @@ -24,7 +24,7 @@ function downloadWebTorrentVideo (target: { magnetUri: string, torrentName?: str if (timer) clearTimeout(timer) return safeWebtorrentDestroy(webtorrent, torrentId, file.name, target.torrentName) - .then(() => rej(new Error('The number of files is not equal to 1 for ' + torrentId))) + .then(() => rej(new Error('Cannot import torrent ' + torrentId + ': there are multiple files in it'))) } file = torrent.files[ 0 ]