From 2254faee770826f5087b1ef83558662b1a57e182 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Fri, 14 Jun 2024 09:51:49 -0500 Subject: [PATCH] chore: limit 68 to deploy error --- src/org/scratchOrgCreate.ts | 3 --- src/org/scratchOrgSettingsGenerator.ts | 12 ++++++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/org/scratchOrgCreate.ts b/src/org/scratchOrgCreate.ts index 4361656c7..49c7a4ce5 100644 --- a/src/org/scratchOrgCreate.ts +++ b/src/org/scratchOrgCreate.ts @@ -288,8 +288,6 @@ export const scratchOrgCreate = async (options: ScratchOrgCreateOptions): Promis }); // anything after this point (org is created and auth'd) is potentially recoverable with the resume scratch command. - process.exitCode = 68; - await scratchOrgAuthInfo.handleAliasAndDefaultSettings({ ...{ alias, @@ -322,7 +320,6 @@ export const scratchOrgCreate = async (options: ScratchOrgCreateOptions): Promis cache.unset(scratchOrgInfoId); const authFields = authInfo.getFields(); await Promise.all([emit({ stage: 'done', scratchOrgInfo: soi }), cache.write(), emitPostOrgCreate(authFields)]); - process.exitCode = 0; return { username, scratchOrgInfo: soi, diff --git a/src/org/scratchOrgSettingsGenerator.ts b/src/org/scratchOrgSettingsGenerator.ts index 0aaeb3996..229f3369d 100644 --- a/src/org/scratchOrgSettingsGenerator.ts +++ b/src/org/scratchOrgSettingsGenerator.ts @@ -329,12 +329,12 @@ export default class SettingsGenerator { const failures = (Array.isArray(componentFailures) ? componentFailures : [componentFailures]) .map((failure) => `[${failure.problemType}] ${failure.fullName} : ${failure.problem} `) .join('\n'); - const error = new SfError( - `A scratch org was created with username ${username}, but the settings failed to deploy due to: \n${failures}`, - 'ProblemDeployingSettings' - ); - error.setData(result); - throw error; + throw SfError.create({ + message: `A scratch org was created with username ${username}, but the settings failed to deploy due to: \n${failures}`, + name: 'ProblemDeployingSettings', + data: { ...result, username }, + exitCode: 68, + }); } }