From abab481f8dbe67086e30fe8fa163111f1a3b5a93 Mon Sep 17 00:00:00 2001 From: Valentin Kaelin Date: Thu, 23 Jul 2020 23:47:03 +0200 Subject: [PATCH] fix: log summoner puuid when riot match endpoint returns a 404 --- server/app/Services/MatchService.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/server/app/Services/MatchService.js b/server/app/Services/MatchService.js index 18bf0fc..c856c03 100644 --- a/server/app/Services/MatchService.js +++ b/server/app/Services/MatchService.js @@ -110,19 +110,15 @@ class MatchService { /* If we have to store some matches in the db */ if (matchesFromApi.length !== 0) { - const ctx = { - account, - } - // Try to see why matches are sometimes undefined matchesFromApi.filter(m => { - if(m === undefined) { - Logger.transport('file').info('Match undefined', matchesToGetFromRiot) + if (m === undefined) { + Logger.transport('file').info(`Match undefined, summoner: ${summonerDB.puuid}`, m) } }) // Transform raw matches data - await BasicMatchTransformer.transform(matchesFromApi, ctx) + await BasicMatchTransformer.transform(matchesFromApi, { account }) /* Save all matches from Riot Api in db */ for (const match of matchesFromApi) {