Skip to content

Commit

Permalink
feat(logging): add logging to track error when retrieving analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
alicehaupais committed Jan 22, 2024
1 parent 01552eb commit ff37f8c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions EcoSonar-API/services/retrieveAnalysisService.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ RetrieveAnalysisService.prototype.getUrlAnalysis = async function (projectName,
w3cAnalysisLastAnalysis = result.w3cLastAnalysis
})
.catch((err) => {
console.error(err)
errorRetrievedW3cAnalysis = err
w3cAnalysisDeployment = []
w3cAnalysisLastAnalysis = null
Expand All @@ -47,6 +48,7 @@ RetrieveAnalysisService.prototype.getUrlAnalysis = async function (projectName,
greenitAnalysisLastAnalysis = formatGreenItAnalysis.greenItUrlAnalysisFormatted(result.lastAnalysis)
})
.catch((err) => {
console.error(err)
errorRetrievedGreenItAnalysis = err
greenitAnalysisDeployment = []
greenitAnalysisLastAnalysis = null
Expand All @@ -58,6 +60,7 @@ RetrieveAnalysisService.prototype.getUrlAnalysis = async function (projectName,
lighthouseResultLastAnalysis = formatLighthouseAnalysis.lighthouseUrlAnalysisFormatted(result.lastAnalysis)
})
.catch((err) => {
console.error(err)
errorRetrievedLighthouseAnalysis = err
lighthouseResultDeployment = []
lighthouseResultLastAnalysis = null
Expand Down Expand Up @@ -117,6 +120,7 @@ RetrieveAnalysisService.prototype.getProjectAnalysis = async function (projectNa
}
})
.catch((err) => {
console.error(err)
catchGreenit = err
})
await lighthouseRepository
Expand All @@ -135,6 +139,7 @@ RetrieveAnalysisService.prototype.getProjectAnalysis = async function (projectNa
}
})
.catch((err) => {
console.error(err)
catchLighthouse = err
})

Expand All @@ -151,6 +156,7 @@ RetrieveAnalysisService.prototype.getProjectAnalysis = async function (projectNa
}
})
.catch((err) => {
console.error(err)
catchW3c = err
})

Expand Down

0 comments on commit ff37f8c

Please sign in to comment.