Skip to content

Commit 823c0e3

Browse files
Merge branch 'prerelease/alpha' into u/kkurri/W-19181248
2 parents ed41e3e + 4758a6c commit 823c0e3

File tree

5 files changed

+20
-9
lines changed

5 files changed

+20
-9
lines changed

messages/assess.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,5 +114,6 @@
114114
"errorParsingData": "Error while parsing data for template",
115115
"errorGeneratingHTML": "Error while generating HTML from template for %s with properties %s",
116116
"unexpectedError": "Unexpected Assessment error",
117-
"errorEvaluatingExpression": "Error evaluating expression: %s, %s"
117+
"errorEvaluatingExpression": "Error evaluating expression: %s, %s",
118+
"invalidTypeAssessErrorMessage": "We couldn't assess your Omnistudio components in the %s namespace. Select the correct namespace and try again"
118119
}

messages/migrate.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,5 +115,6 @@
115115
"labelStatusComplete": "Complete",
116116
"migrationConsentNotGiven": "Couldn't confirm whether assessment errors are resolved",
117117
"migrationConsentMessage": "Ensure that all items in the assessment report are marked as Green before proceeding with the migration. Do you want to proceed?",
118-
"truncationFailed": "Truncation failed for %s: %s"
118+
"truncationFailed": "Truncation failed for %s: %s",
119+
"invalidTypeMigrateErrorMessage": "We couldn't migrate your Omnistudio components in the %s namespace. Select the correct namespace and try again"
119120
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@salesforce/plugin-omnistudio-migration-tool",
33
"description": "This SFDX plugin migrates FlexCard, OmniScript, DataRaptor, and Integration Procedure custom objects to standard objects.",
4-
"version": "2.0.0-beta.23",
4+
"version": "2.0.0-beta.24",
55
"author": "Salesforce",
66
"bugs": "https://github.com/forcedotcom/cli/issues",
77
"dependencies": {

src/commands/omnistudio/migration/assess.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import OmniStudioBaseCommand from '../../basecommand';
55
import { AssessmentInfo } from '../../../utils/interfaces';
66
import { AssessmentReporter } from '../../../utils/resultsbuilder/assessmentReporter';
77
import { OmniScriptExportType, OmniScriptMigrationTool } from '../../../migration/omniscript';
8+
import { InvalidEntityTypeError } from '../../../migration/interfaces';
89
import { CardMigrationTool } from '../../../migration/flexcard';
910
import { DataRaptorMigrationTool } from '../../../migration/dataraptor';
1011
import { DebugTimer } from '../../../utils';
@@ -116,9 +117,13 @@ export default class Assess extends OmniStudioBaseCommand {
116117
try {
117118
// Assess OmniStudio components
118119
await this.assessOmniStudioComponents(assesmentInfo, assessOnly, namespace, conn, allVersions);
119-
} catch (error) {
120-
Logger.error(`Cannot assess OmniStudio components within ${namespace}`);
121-
process.exit(1);
120+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
121+
} catch (ex: any) {
122+
if (ex instanceof InvalidEntityTypeError) {
123+
Logger.error(`${messages.getMessage('invalidTypeAssessErrorMessage', [namespace])}`);
124+
process.exit(1);
125+
}
126+
Logger.error('Error assessing object', ex);
122127
}
123128

124129
let objectsToProcess: string[];

src/commands/omnistudio/migration/migrate.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ export default class Migrate extends OmniStudioBaseCommand {
176176
}
177177

178178
if (allTruncateComplete) {
179-
objectMigrationResults = await this.migrateObjects(migrationObjects, debugTimer);
179+
objectMigrationResults = await this.migrateObjects(migrationObjects, debugTimer, namespace);
180180
}
181181

182182
const omnistudioRelatedObjectsMigration = new OmnistudioRelatedObjectMigrationFacade(
@@ -281,7 +281,11 @@ export default class Migrate extends OmniStudioBaseCommand {
281281
return objectMigrationResults;
282282
}
283283

284-
private async migrateObjects(migrationObjects: MigrationTool[], debugTimer: DebugTimer): Promise<MigratedObject[]> {
284+
private async migrateObjects(
285+
migrationObjects: MigrationTool[],
286+
debugTimer: DebugTimer,
287+
namespace: string
288+
): Promise<MigratedObject[]> {
285289
let objectMigrationResults: MigratedObject[] = [];
286290
// Migrate in correct dependency order
287291
// DM -> IP -> OS -> FC
@@ -301,7 +305,7 @@ export default class Migrate extends OmniStudioBaseCommand {
301305
);
302306
} catch (ex: any) {
303307
if (ex instanceof InvalidEntityTypeError) {
304-
Logger.error(ex.message);
308+
Logger.error(messages.getMessage('invalidTypeMigrateErrorMessage', [namespace]));
305309
process.exit(1);
306310
}
307311
Logger.error('Error migrating object', ex);

0 commit comments

Comments
 (0)