+ webtorrent.on('error', err => console.error('Error in webtorrent', err))
+
+ return new Promise<WebTorrent.Torrent>(res => {
+ const torrent = webtorrent.add(torrentId, res)
+
+ torrent.on('error', err => console.error('Error in webtorrent torrent', err))
+ torrent.on('warning', warn => {
+ const msg = typeof warn === 'string'
+ ? warn
+ : warn.message
+
+ if (msg.includes('Unsupported')) return
+
+ console.error('Warning in webtorrent torrent', warn)
+ })
+ })