server: torrents: properly catch errors of multiple awaits in /details

This commit is contained in:
Jesse Chan
2020-12-10 18:58:01 +08:00
parent f4bf39ef1c
commit e4d24c76ff
+2
View File
@@ -632,6 +632,8 @@ router.get('/:hash/details', async (req, res) => {
const peers = req.services?.clientGatewayService?.getTorrentPeers(req.params.hash);
const trackers = req.services?.clientGatewayService?.getTorrentTrackers(req.params.hash);
await Promise.all([contents, peers, trackers]);
callback({
contents: await contents,
peers: await peers,