add more logs

This commit is contained in:
2022-10-11 23:14:31 +02:00
parent e06439bf84
commit 55ca30c1d3
3 changed files with 14 additions and 4 deletions
+5
View File
@@ -107,3 +107,8 @@ adb -s 8f76f9e7 shell am start -n com.android.chrome/com.google.android.apps.chr
adb -s c3ba032e shell pm clear com.android.chrome
adb -s c3ba032e shell am set-debug-app --persistent com.android.chrome
adb -s c3ba032e shell am start -n com.android.chrome/com.google.android.apps.chrome.Main
#xiao mi 3
adb -s 2140c70c shell pm clear com.android.chrome
adb -s 2140c70c shell am set-debug-app --persistent com.android.chrome
adb -s 2140c70c shell am start -n com.android.chrome/com.google.android.apps.chrome.Main
+5
View File
@@ -87,3 +87,8 @@ adb -s e08f0a85 shell am start -n com.android.chrome/com.google.android.apps.chr
adb -s 192.168.1.24:42397 shell pm clear com.android.chrome
adb -s 192.168.1.24:42397 shell am set-debug-app --persistent com.android.chrome
adb -s 192.168.1.24:42397 shell am start -n com.android.chrome/com.google.android.apps.chrome.Main
#xiao mi 3
adb -s 2140c70c shell pm clear com.android.chrome
adb -s 2140c70c shell am set-debug-app --persistent com.android.chrome
adb -s 2140c70c shell am start -n com.android.chrome/com.google.android.apps.chrome.Main
+4 -4
View File
@@ -294,7 +294,6 @@ class CommandorPage {
}
async onPageLoad(currentPage) {
console.log("onPageLoad called, url is " + currentPage.url())
try {
let content = await currentPage.content();
let captcha_url = "geo.captcha-delivery.com/captcha";
@@ -319,7 +318,7 @@ class CommandorPage {
log("successful");
await this.push_message_to_queue(PublishType.SUCCESS);
} else if (content.includes(EMPTY_RESPONSE_ERROR)) {
console.log("EMPTY_RESPONSE_ERROR error received, will quit")
log("EMPTY_RESPONSE_ERROR error received, will quit")
this.isTerminated = true
} else {
// try to get errors
@@ -388,7 +387,6 @@ class CommandorPage {
let errorItem = this.page.locator("div.alert");
if (errorItem) {
let errorContent = await errorItem.innerHTML();
log("error:" + errorContent);
await this.handleError(errorContent);
}
} catch (e) {
@@ -398,10 +396,12 @@ class CommandorPage {
}
async handleError(errorContent) {
log("handle error:" + errorContent);
if (errorContent.includes(DOUBLE_REQUEST_ERROR_MESSAGE) || errorContent.includes(DOUBLE_REQUEST_ERROR_MESSAGE_FR)) {
this.isTerminated = true;
} else if (errorContent.includes(TOO_MANY_REQUEST_ERROR_MESSAGE) || errorContent.includes(TOO_MANY_REQUEST_ERROR_MESSAGE_FR)) {
// todo, add contact to black list
//add contact to black list and set terminated the task
log("handle error: will save to black list db");
await this.saveToBlackList()
} else if (errorContent.includes(CAPTCHA_ERROR_MESSAGE) || errorContent.includes(CAPTCHA_ERROR_MESSAGE_FR)) {
this.isTerminated = true;