handle incorrect phone number error

This commit is contained in:
Lei PAN
2024-02-23 19:03:06 +01:00
parent 99953c758f
commit 16788745f4
3 changed files with 9 additions and 0 deletions
+1
View File
@@ -1,5 +1,6 @@
const OCRResult = { const OCRResult = {
SUCCESS: Symbol("SUCCESS"), SUCCESS: Symbol("SUCCESS"),
WRONG_PHONE_NUMBER: Symbol("WRONG_PHONE_NUMBER"),
TO_REFRESH: Symbol("TO_REFRESH"), TO_REFRESH: Symbol("TO_REFRESH"),
BLOCKED: Symbol("BLOCKED"), BLOCKED: Symbol("BLOCKED"),
SLIDING_CAPTCHA: Symbol("SLIDING_CAPTCHA"), SLIDING_CAPTCHA: Symbol("SLIDING_CAPTCHA"),
+4
View File
@@ -1095,6 +1095,10 @@ class CommandorPage {
: :
await this.connect_to_browser(OCRResult.TO_REFRESH) await this.connect_to_browser(OCRResult.TO_REFRESH)
break; break;
case OCRResult.WRONG_PHONE_NUMBER
:
this.isTerminated = true
break;
case case
OCRResult.BLOCKED OCRResult.BLOCKED
: :
+4
View File
@@ -19,6 +19,7 @@ const MESSAGE_URL_VALIDATION_FR = "Vous recevrez un email de validation"
const MESSAGE_URL_VALIDATION_FR_2 = "Merci de votre intérêt pour notre Maison" const MESSAGE_URL_VALIDATION_FR_2 = "Merci de votre intérêt pour notre Maison"
const SSL_CERT_ERROR = " Votre connexion n'est pas privée" const SSL_CERT_ERROR = " Votre connexion n'est pas privée"
const MESSAGE_URL_VALIDATION_EN = "Please click on the link we sent by email" const MESSAGE_URL_VALIDATION_EN = "Please click on the link we sent by email"
const WRONG_PHONE_NUMBER = "Veuillez renseigner vote numéro de téléphone"
const CHOOSE_POSITION_GOOGLE_FR = " Choisir la position pour les résultats de recherche" const CHOOSE_POSITION_GOOGLE_FR = " Choisir la position pour les résultats de recherche"
const CAPTCHA_ERROR_MESSAGE = "Error verifying captcha, please try again" const CAPTCHA_ERROR_MESSAGE = "Error verifying captcha, please try again"
const CAPTCHA_ERROR_MESSAGE_FR = "La vérification du captcha a échoué" const CAPTCHA_ERROR_MESSAGE_FR = "La vérification du captcha a échoué"
@@ -109,6 +110,9 @@ class OCRChecker {
} else if (result.includes(SSL_CERT_ERROR)) { } else if (result.includes(SSL_CERT_ERROR)) {
await this.deleteFile(fileName) await this.deleteFile(fileName)
return OCRResult.SSL_CERT_ERROR return OCRResult.SSL_CERT_ERROR
} else if (result.includes(WRONG_PHONE_NUMBER)) {
await this.deleteFile(fileName)
return OCRResult.WRONG_PHONE_NUMBER
} else if (result.includes(MESSAGE_FILL_FIELD_FR) || result.includes(MESSAGE_FILL_FIELD_FR_2) || result.includes(MESSAGE_FILL_FIELD_FR_3) || result.includes(MESSAGE_FILL_FIELD_FR_4) || result.includes(MESSAGE_FILL_FIELD_FR_5) || result.includes(MESSAGE_FILL_FIELD_FR_6)) { } else if (result.includes(MESSAGE_FILL_FIELD_FR) || result.includes(MESSAGE_FILL_FIELD_FR_2) || result.includes(MESSAGE_FILL_FIELD_FR_3) || result.includes(MESSAGE_FILL_FIELD_FR_4) || result.includes(MESSAGE_FILL_FIELD_FR_5) || result.includes(MESSAGE_FILL_FIELD_FR_6)) {
await this.deleteFile(fileName) await this.deleteFile(fileName)
return OCRResult.FILL_FIELD return OCRResult.FILL_FIELD