add logs
This commit is contained in:
@@ -163,9 +163,9 @@ class LinkValidator {
|
|||||||
|
|
||||||
async onResponse(response) {
|
async onResponse(response) {
|
||||||
// let rex = new RegExp(REGEX_RDV_URL)
|
// let rex = new RegExp(REGEX_RDV_URL)
|
||||||
log(this.device.model + ":onResponse url:" + response.url())
|
log(this.device.model() + ":onResponse url:" + response.url())
|
||||||
log(this.device.model + ":onResponse with statusCode:" + response.statusCode)
|
log(this.device.model() + ":onResponse with statusCode:" + response.statusCode)
|
||||||
log(this.device.model + ":onResponse with message:" + response.statusMessage)
|
log(this.device.model() + ":onResponse with message:" + response.statusMessage)
|
||||||
// if (rex.test(response.url())) {
|
// if (rex.test(response.url())) {
|
||||||
// log("rdv url found:" + response.url())
|
// log("rdv url found:" + response.url())
|
||||||
// await this.push_message_to_db(PublishType.SUCCESS, response.url())
|
// await this.push_message_to_db(PublishType.SUCCESS, response.url())
|
||||||
@@ -201,12 +201,12 @@ class LinkValidator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async handleError(errorContent) {
|
async handleError(errorContent) {
|
||||||
log(this.device.model + ":handle error:" + errorContent);
|
log(this.device.model() + ":handle error:" + errorContent);
|
||||||
if (errorContent.includes(DOUBLE_REQUEST_ERROR_MESSAGE) || errorContent.includes(DOUBLE_REQUEST_ERROR_MESSAGE_FR)) {
|
if (errorContent.includes(DOUBLE_REQUEST_ERROR_MESSAGE) || errorContent.includes(DOUBLE_REQUEST_ERROR_MESSAGE_FR)) {
|
||||||
this.isTerminated = true;
|
this.isTerminated = true;
|
||||||
} else if (errorContent.includes(TOO_MANY_REQUEST_ERROR_MESSAGE) || errorContent.includes(TOO_MANY_REQUEST_ERROR_MESSAGE_FR)) {
|
} else if (errorContent.includes(TOO_MANY_REQUEST_ERROR_MESSAGE) || errorContent.includes(TOO_MANY_REQUEST_ERROR_MESSAGE_FR)) {
|
||||||
//add contact to black list and set terminated the task
|
//add contact to black list and set terminated the task
|
||||||
log(this.device.model + ":handle error: will save to black list db");
|
log(this.device.model() + ":handle error: will save to black list db");
|
||||||
} else if (errorContent.includes(CAPTCHA_ERROR_MESSAGE) || errorContent.includes(CAPTCHA_ERROR_MESSAGE_FR)) {
|
} else if (errorContent.includes(CAPTCHA_ERROR_MESSAGE) || errorContent.includes(CAPTCHA_ERROR_MESSAGE_FR)) {
|
||||||
this.isTerminated = true;
|
this.isTerminated = true;
|
||||||
}
|
}
|
||||||
@@ -214,7 +214,7 @@ class LinkValidator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async resetBrowser() {
|
async resetBrowser() {
|
||||||
console.log(this.device.model + ":will reset browser")
|
console.log(this.device.model() + ":will reset browser")
|
||||||
await this.device.shell("pm clear com.android.chrome")
|
await this.device.shell("pm clear com.android.chrome")
|
||||||
await delay(1000)
|
await delay(1000)
|
||||||
await this.device.shell("am set-debug-app --persistent com.android.chrome")
|
await this.device.shell("am set-debug-app --persistent com.android.chrome")
|
||||||
|
|||||||
Reference in New Issue
Block a user