Make sure all exit calls use ExitCodes enum (#767)

Quick follow-up to #584 to make sure enum is used everywhere in profile editing mode:
- profile browser exits with ExitCodes.SignalInterrupted in response to signal
- use ExitCodes.Success or GenericError for other exit codes
This commit is contained in:
Tessa Walsh 2025-02-11 15:04:38 -05:00 committed by GitHub
parent 4b72b7c7dc
commit f16be32ba6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -147,7 +147,7 @@ function getDefaultWindowSize() {
function handleTerminate(signame: string) { function handleTerminate(signame: string) {
logger.info(`Got signal ${signame}, exiting`); logger.info(`Got signal ${signame}, exiting`);
process.exit(ExitCodes.GenericError); process.exit(ExitCodes.SignalInterrupted);
} }
async function main() { async function main() {
@ -299,7 +299,7 @@ async function automatedProfile(
} }
logger.debug("Login form could not be found"); logger.debug("Login form could not be found");
await page.close(); await page.close();
process.exit(1); process.exit(ExitCodes.GenericError);
return; return;
} }
@ -318,7 +318,7 @@ async function automatedProfile(
await createProfile(params, browser, page, cdp); await createProfile(params, browser, page, cdp);
process.exit(0); process.exit(ExitCodes.Success);
} }
async function createProfile( async function createProfile(