exit codes: exit with error code 10 if interrupt is caused by unexpected browser exit (#686)

Differentiate from expected/predictable interrupts due to limits (exit
code 11) and unexpected interrupt due to browser crash (now exit code
10)
fixes #683
This commit is contained in:
Ilya Kreymer 2024-09-12 09:10:23 -07:00 committed by GitHub
parent fdb76f2c88
commit eb50fdffde
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -170,6 +170,7 @@ export class Crawler {
skipTextDocs = 0;
interrupted = false;
browserCrashed = false;
finalExit = false;
uploadAndDeleteLocal = false;
done = false;
@ -582,7 +583,7 @@ export class Crawler {
logger.info("Crawl gracefully stopped on request");
} else if (this.interrupted) {
status = "interrupted";
exitCode = 11;
exitCode = this.browserCrashed ? 10 : 11;
}
}
} catch (e) {
@ -1444,6 +1445,7 @@ self.__bx_behaviors.selectMainBehavior();
err,
"browser",
);
this.browserCrashed = true;
},
recording: this.recording,