Skip to content

Commit

Permalink
feat: use v3 error/messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed May 8, 2022
1 parent 488fbfa commit 41676ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/shared/localShadowRepo.ts
Expand Up @@ -8,7 +8,7 @@
import * as path from 'path';
import * as os from 'os';
import * as fs from 'graceful-fs';
import { NamedPackageDir, Logger, SfdxError } from '@salesforce/core';
import { NamedPackageDir, Logger, SfError } from '@salesforce/core';
import * as git from 'isomorphic-git';
import { chunkArray, pathIsInFolder } from './functions';

Expand Down Expand Up @@ -243,7 +243,7 @@ export class ShadowRepo {
} catch (e) {
if (e instanceof git.Errors.MultipleGitError) {
this.logger.error('multiple errors on git.add', e.errors.slice(0, 5));
const error = new SfdxError(e.message, e.name, [], 1);
const error = new SfError(e.message, e.name, [], 1);
error.setData(e.errors);
throw error;
}
Expand Down
8 changes: 4 additions & 4 deletions src/shared/remoteSourceTrackingService.ts
Expand Up @@ -10,7 +10,7 @@
import * as path from 'path';
import * as fs from 'fs';
import { retryDecorator, NotRetryableError } from 'ts-retry-promise';
import { ConfigFile, Logger, Org, SfdxError, Messages, Lifecycle, SfError } from '@salesforce/core';
import { ConfigFile, Logger, Org, Messages, Lifecycle, SfError } from '@salesforce/core';
import { ComponentStatus } from '@salesforce/source-deploy-retrieve';
import { Dictionary, Optional } from '@salesforce/ts-types';
import { env, Duration } from '@salesforce/kit';
Expand Down Expand Up @@ -140,7 +140,7 @@ export class RemoteSourceTrackingService extends ConfigFile<RemoteSourceTracking
try {
await super.init();
} catch (err) {
throw SfdxError.wrap(err as Error);
throw SfError.wrap(err as Error);
}

const contents = this.getTypedContents();
Expand All @@ -160,7 +160,7 @@ export class RemoteSourceTrackingService extends ConfigFile<RemoteSourceTracking
} catch (e) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
if (
e instanceof SfdxError &&
e instanceof SfError &&
e.name === 'INVALID_TYPE' &&
e.message.includes("sObject type 'SourceMember' is not supported")
) {
Expand Down Expand Up @@ -647,7 +647,7 @@ export class RemoteSourceTrackingService extends ConfigFile<RemoteSourceTracking
});
return results.records;
} catch (error) {
throw SfdxError.wrap(error as Error);
throw SfError.wrap(error as Error);
}
}
}
Expand Down

0 comments on commit 41676ff

Please sign in to comment.