catch error for inputing solution

This commit is contained in:
2022-09-09 14:07:53 +02:00
parent 1c5325cb9b
commit ffd49a3a87
+10 -1
View File
@@ -197,10 +197,19 @@ class CommandorPage {
await this.captchaSolver.start((solution) => { await this.captchaSolver.start((solution) => {
console.log("solution is: " + solution); console.log("solution is: " + solution);
if (solution !== ERROR_CAPTCHA_UNSOLVABLE) { if (solution !== ERROR_CAPTCHA_UNSOLVABLE) {
try {
page.evaluate((solution) => { page.evaluate((solution) => {
document.getElementById("g-recaptcha-response").innerHTML = solution; document.getElementById("g-recaptcha-response").innerHTML = solution;
}, solution) }, solution)
this.clickValid();} this.clickValid();
}
catch
(e)
{
console.log(e)
this.isTerminated = true;
}
}
else{ else{
this.isTerminated = true; this.isTerminated = true;
} }