diff --git a/src/core/contractActivation.js b/src/core/contractActivation.js index fe80491885cf975b7e2b880857d55b242cda8aac..aa24d5115304684b288781b2e51129fd78278b86 100644 --- a/src/core/contractActivation.js +++ b/src/core/contractActivation.js @@ -47,7 +47,7 @@ async function activateContract( log('error', 'commanderCollectePublicationMesures') log('error', err) Sentry.captureException('commanderCollectePublicationMesures', err) - throw errors.LOGIN_FAILED + throw errors.CAPTCHA_RESOLUTION_FAILED }) const parsedReply = await xml2js.parseStringPromise(response.body, { @@ -71,7 +71,7 @@ async function activateContract( //TODO: handle SGT4B8: Il existe déjà plusieurs demandes en cours sur le point ? //TODO: handle SGT4H9: La demande ne porte pas sur un point équipé d'un compteur communicant ouvert aux services niveau 2. //TODO: handle SGT589: La demande ne peut pas aboutir car le compteur n'est actuellement pas téléopérable. - throw errors.LOGIN_FAILED + throw errors.CAPTCHA_RESOLUTION_FAILED } } diff --git a/src/core/contractVerification.js b/src/core/contractVerification.js index 8bc1c6f2716567969268875f1472b77acf16d5c2..6757f1b43ea6b688a52e881ba37df37052e54b70 100644 --- a/src/core/contractVerification.js +++ b/src/core/contractVerification.js @@ -34,7 +34,7 @@ async function verifyContract(url, apiAuthKey, appLogin, contractId, pointId) { log('error', 'rechercherServicesSouscritsMesures') log('error', err) Sentry.captureException('rechercherServicesSouscritsMesures', err) - throw errors.LOGIN_FAILED + throw errors.CAPTCHA_RESOLUTION_FAILED }) const parsedReply = await xml2js.parseStringPromise(response.body, { @@ -77,7 +77,7 @@ async function verifyContract(url, apiAuthKey, appLogin, contractId, pointId) { 'error', 'if an error is thrown here, it probably means that the contract has already been open today and that enedis cannot open a second one. Wait until tomorow to try again' ) - throw errors.LOGIN_FAILED + throw errors.CAPTCHA_RESOLUTION_FAILED } }