Skip to content

Commit

Permalink
Make sure all exit calls use ExitCodes enum (#767)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tw4l authored Feb 11, 2025
1 parent 4b72b7c commit f16be32
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/create-login-profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function getDefaultWindowSize() {

function handleTerminate(signame: string) {
logger.info(`Got signal ${signame}, exiting`);
process.exit(ExitCodes.GenericError);
process.exit(ExitCodes.SignalInterrupted);
}

async function main() {
Expand Down Expand Up @@ -299,7 +299,7 @@ async function automatedProfile(
}
logger.debug("Login form could not be found");
await page.close();
process.exit(1);
process.exit(ExitCodes.GenericError);
return;
}

Expand All @@ -318,7 +318,7 @@ async function automatedProfile(

await createProfile(params, browser, page, cdp);

process.exit(0);
process.exit(ExitCodes.Success);
}

async function createProfile(
Expand Down

0 comments on commit f16be32

Please sign in to comment.