Skip to content

Commit 38114a3

Browse files
committed
fix: warnings about tracking aren't a throw (org will still auth, default)
1 parent a54f0e1 commit 38114a3

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/org/scratchOrgCreate.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { Messages } from '../messages';
1010
import { Logger } from '../logger';
1111
import { ConfigAggregator } from '../config/configAggregator';
1212
import { SfProject } from '../sfProject';
13-
import { SfError } from '../sfError';
13+
import { Lifecycle } from '../lifecycleEvents';
1414
import { Org } from './org';
1515
import {
1616
authorizeScratchOrg,
@@ -212,15 +212,16 @@ const getSignupTargetLoginUrl = async (): Promise<string | undefined> => {
212212
const updateRevisionCounterToZero = async (scratchOrg: Org): Promise<void> => {
213213
const conn = scratchOrg.getConnection();
214214
const queryResult = await conn.tooling.sobject('SourceMember').find({ RevisionCounter: { $gt: 0 } }, ['Id']);
215+
if (queryResult.length === 0) {
216+
return;
217+
}
215218
try {
216219
await conn.tooling
217220
.sobject('SourceMember')
218221
.update(queryResult.map((record) => ({ Id: record.Id, RevisionCounter: 0 })));
219222
} catch (err) {
220-
const message = messages.getMessage('SourceStatusResetFailureError', [
221-
scratchOrg.getOrgId(),
222-
scratchOrg.getUsername(),
223-
]);
224-
throw new SfError(message, 'SourceStatusResetFailure');
223+
await Lifecycle.getInstance().emitWarning(
224+
messages.getMessage('SourceStatusResetFailureError', [scratchOrg.getOrgId(), scratchOrg.getUsername()])
225+
);
225226
}
226227
};

0 commit comments

Comments
 (0)