Forward fetch error message to user

This commit is contained in:
Mattéo Delabre 2021-12-04 12:40:11 -05:00
parent efb3ee1804
commit 57abc1a1bb
Signed by: matteo
GPG Key ID: AE3FBD02DC583ABB
1 changed files with 3 additions and 2 deletions

View File

@ -54,7 +54,7 @@ ${cache[videoId][1]}…`);
} }
else if (cache[videoId][0] === statusError) else if (cache[videoId][0] === statusError)
{ {
res.status(500).send('Error'); res.status(500).send(`Error: ${cache[videoId][1]}`);
} }
else else
{ {
@ -86,7 +86,8 @@ ${cache[videoId][1]}…`);
catch (err) catch (err)
{ {
console.error(err); console.error(err);
cache[videoId] = [statusError]; console.log(`setting cache error to ${videoId}`)
cache[videoId] = [statusError, err.message];
} }
} }
}); });