Skip to content
Snippets Groups Projects
Commit f4d02eb4 authored by Bastien DUMONT's avatar Bastien DUMONT :angel:
Browse files

log once per second change onboarding

parent 360f587a
No related branches found
No related tags found
1 merge request!27Resolve "Mise en place de sentry - sge"
Pipeline #48405 passed
......@@ -59,9 +59,7 @@ async function findUserPdl(
try {
return parseUserPdl(parsedReply)
} catch (error) {
const errorMessage = 'Error while parsing user PDL: ' + error
log('warn', errorMessage)
Sentry.captureException(errorMessage)
log('warn', 'Error while parsing user PDL: ' + error)
if (parsedReply.Envelope.Body.Fault) {
log(
'warn',
......
......@@ -47,8 +47,9 @@ async function verifyUserIdentity(
)
if (!pdl) {
log('warn', 'Second chance for sge onboarding')
// TODO add "Second chance" to Sentry transaction
const warningMessage = 'Second chance for sge onboarding'
log('warn', warningMessage)
Sentry.captureMessage(warningMessage)
// Set safety onboarding in order to save it inside BO
userSafetyOnBoarding = true
// Backup verification
......@@ -87,9 +88,10 @@ async function verifyUserIdentity(
userAddress.commune.$.code
)
}
// Third try, remove address number and add escalierEtEtageEtAppartement because it's buggy on SGE side
// Fourth try, remove address number and add escalierEtEtageEtAppartement because it's buggy on SGE side
if (!pdl) {
log('warn', 'Last chance onboarding for sge')
log('warn', 'Fourth chance onboarding for sge')
pdl = await findUserPdl(
`${baseUrl}/enedis_SDE_recherche-point/1.0`,
apiAuthKey,
......@@ -101,6 +103,10 @@ async function verifyUserIdentity(
escalierEtEtageEtAppartement
)
}
if (!pdl) {
Sentry.captureException('Second chance failed, no pdl found')
}
}
if (fields.pointId != pdl) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment