Skip to content
Snippets Groups Projects
Commit e69a8e35 authored by Hugo SUBTIL's avatar Hugo SUBTIL
Browse files

fix: switch to warning log because it was making the app failing

parent 14be798c
Branches
Tags
No related merge requests found
Pipeline #43633 passed
...@@ -52,7 +52,7 @@ async function verifyContract(url, apiAuthKey, appLogin, contractId, pointId) { ...@@ -52,7 +52,7 @@ async function verifyContract(url, apiAuthKey, appLogin, contractId, pointId) {
if (Array.isArray(currentContracts)) { if (Array.isArray(currentContracts)) {
currentContract = parseContracts(parsedReply)[0] currentContract = parseContracts(parsedReply)[0]
} else { } else {
currentContract = parseContracts(parsedReply) currentContract = currentContracts
} }
if ( if (
(currentContract.etatCode === contractState.ACTIF || (currentContract.etatCode === contractState.ACTIF ||
......
...@@ -25,7 +25,7 @@ async function findUserPdl( ...@@ -25,7 +25,7 @@ async function findUserPdl(
inseeCode, inseeCode,
escalierEtEtageEtAppartement = '' escalierEtEtageEtAppartement = ''
) { ) {
log('info', 'Fetching user data') log('info', 'Fetching user pdl')
const sgeHeaders = { const sgeHeaders = {
'Content-Type': 'text/xml;charset=UTF-8', 'Content-Type': 'text/xml;charset=UTF-8',
apikey: apiAuthKey, apikey: apiAuthKey,
...@@ -57,10 +57,10 @@ async function findUserPdl( ...@@ -57,10 +57,10 @@ async function findUserPdl(
try { try {
return parseUserPdl(parsedReply) return parseUserPdl(parsedReply)
} catch (error) { } catch (error) {
log('error', 'Error while parsing user PDL: ' + error) log('warn', 'Error while parsing user PDL: ' + error)
if (parsedReply.Envelope.Body.Fault) { if (parsedReply.Envelope.Body.Fault) {
log( log(
'error', 'warn',
`Enedis issue ${parsedReply.Envelope.Body.Fault.detail.erreur.resultat.$.code}: ${parsedReply.Envelope.Body.Fault.faultstring}` `Enedis issue ${parsedReply.Envelope.Body.Fault.detail.erreur.resultat.$.code}: ${parsedReply.Envelope.Body.Fault.faultstring}`
) )
} }
......
...@@ -219,6 +219,7 @@ async function start(fields, cozyParameters) { ...@@ -219,6 +219,7 @@ async function start(fields, cozyParameters) {
log('info', 'Successfully logged in') log('info', 'Successfully logged in')
await gatherData(baseUrl, apiAuthKey, sgeLogin, pointId) await gatherData(baseUrl, apiAuthKey, sgeLogin, pointId)
log('info', 'Konnector success')
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment