]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/webtorrent.ts
Don't throw when there is no error
[github/Chocobozzz/PeerTube.git] / server / helpers / webtorrent.ts
index 5fe4c1165c24fdd37f183f4a23a601e48fc4b083..813ebc2361f77965c129df369acfc8b318e868d1 100644 (file)
@@ -50,7 +50,7 @@ async function downloadWebTorrentVideo (target: { magnetUri: string, torrentName
           .then(() => rej(new Error('Cannot import torrent ' + torrentId + ': there are multiple files in it')))
       }
 
-      logger.debug('Got torrent from webtorrent %s.', id, { infoHash: torrent.infoHash, files: torrent.files })
+      logger.debug('Got torrent from webtorrent %s.', id, { infoHash: torrent.infoHash })
 
       file = torrent.files[0]
 
@@ -67,7 +67,9 @@ async function downloadWebTorrentVideo (target: { magnetUri: string, torrentName
       pipeline(
         file.createReadStream(),
         writeStream,
-        err => rej(err)
+        err => {
+          if (err) rej(err)
+        }
       )
     })