Skip to content

Commit 1dd8a07

Browse files
authored
Merge pull request #901 from contentstack/development
Staging <- Development : 10/07/2023
2 parents 1fc05c9 + 8a90954 commit 1dd8a07

2 files changed

Lines changed: 16 additions & 16 deletions

File tree

packages/contentstack-export/src/export/module-exporter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class ModuleExporter {
7474
}
7575

7676
// set master locale to config
77-
if (moduleName === 'stack' && exportedModuleResponse.code) {
77+
if (moduleName === 'stack' && exportedModuleResponse?.code) {
7878
this.exportConfig.master_locale = { code: exportedModuleResponse.code };
7979
}
8080
}

packages/contentstack-import/src/import/modules-js/entries.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ module.exports = class ImportEntries {
106106
} catch (error) {
107107
addlogs(
108108
this.config,
109-
`Failed to read the content types to import entries ${util.formatError(error)}`,
109+
`Failed to read the content types to import entries ${formatError(error)}`,
110110
'error',
111111
);
112112
process.exit(0);
@@ -160,7 +160,7 @@ module.exports = class ImportEntries {
160160
} catch (error) {
161161
addlogs(
162162
self.config,
163-
`Failed get the existing entries to update the mapper ${util.formatError(error)}, 'error`,
163+
`Failed get the existing entries to update the mapper ${formatError(error)}, 'error`,
164164
);
165165
}
166166
log(this.config, 'Starting to update entries with references', 'info');
@@ -193,7 +193,7 @@ module.exports = class ImportEntries {
193193
} catch (error) {
194194
addlogs(
195195
self.config,
196-
`Failed to update the field rules for content type '${schema.uid}' ${util.formatError(error)}`,
196+
`Failed to update the field rules for content type '${schema.uid}' ${formatError(error)}`,
197197
'error',
198198
);
199199
}
@@ -287,7 +287,7 @@ module.exports = class ImportEntries {
287287
);
288288
} catch (error) {
289289
addlogs(this.config, 'Failed to update entry while creating entry id ' + eUid);
290-
addlogs(this.config, util.formatError(error), 'error');
290+
addlogs(this.config, formatError(error), 'error');
291291
}
292292
}
293293
}
@@ -588,7 +588,7 @@ module.exports = class ImportEntries {
588588
} catch (error) {
589589
addlogs(
590590
this.config,
591-
`Failed to update the entry ${uid} references while reposting ${util.formatError(error)}`,
591+
`Failed to update the entry ${uid} references while reposting ${formatError(error)}`,
592592
'error',
593593
);
594594
}
@@ -667,7 +667,7 @@ module.exports = class ImportEntries {
667667
.catch((error) => {
668668
// error while executing entry in batch
669669
addlogs(this.config, `Failed re-post entries at batch no: '${index + 1}`, 'error');
670-
addlogs(this.config, util.formatError(error), 'error');
670+
addlogs(this.config, formatError(error), 'error');
671671
// throw error;
672672
});
673673
},
@@ -686,7 +686,7 @@ module.exports = class ImportEntries {
686686
.catch((error) => {
687687
// error while updating entries with references
688688
addlogs(this.config, `Failed re-post entries of content type ${ctUid} locale ${lang}`, 'error');
689-
addlogs(this.config, util.formatError(error), 'error');
689+
addlogs(this.config, formatError(error), 'error');
690690
// throw error;
691691
});
692692
},
@@ -776,7 +776,7 @@ module.exports = class ImportEntries {
776776
// empty function
777777
})
778778
.catch((_error) => {
779-
addlogs(this.config, util.formatError(error), 'error');
779+
addlogs(this.config, formatError(error), 'error');
780780
reject(`Failed suppress content type ${schema.uid} reference fields`);
781781
});
782782
// update 5 content types at a time
@@ -940,7 +940,7 @@ module.exports = class ImportEntries {
940940
})
941941
.catch((error) => {
942942
addlogs(this.config, chalk.red('Failed to remove bugged entry from master language'), 'error');
943-
addlogs(this.config, util.formatError(error), 'error');
943+
addlogs(this.config, formatError(error), 'error');
944944
});
945945
},
946946
{
@@ -963,7 +963,7 @@ module.exports = class ImportEntries {
963963
})
964964
.catch((error) => {
965965
// error while removing bugged entries from stack
966-
addlogs(this.config, util.formatError(error), 'error');
966+
addlogs(this.config, formatError(error), 'error');
967967
});
968968
});
969969
}
@@ -1096,7 +1096,7 @@ module.exports = class ImportEntries {
10961096
.catch((err) => {
10971097
addlogs(
10981098
this.config,
1099-
`failed to publish entry '${eUid}' content type '${ctUid}' ${util.formatError(
1099+
`failed to publish entry '${eUid}' content type '${ctUid}' ${formatError(
11001100
err,
11011101
)}`,
11021102
'error',
@@ -1118,7 +1118,7 @@ module.exports = class ImportEntries {
11181118
})
11191119
.catch((error) => {
11201120
// error while executing entry in batch
1121-
addlogs(this.config, util.formatError(error), 'error');
1121+
addlogs(this.config, formatError(error), 'error');
11221122
addlogs(this.config, error, 'error');
11231123
});
11241124
},
@@ -1134,7 +1134,7 @@ module.exports = class ImportEntries {
11341134
console.log(error);
11351135
addlogs(
11361136
this.config,
1137-
`failed to publish entry in content type '${ctUid}' ${util.formatError(error)}`,
1137+
`failed to publish entry in content type '${ctUid}' ${formatError(error)}`,
11381138
'error',
11391139
);
11401140
});
@@ -1149,7 +1149,7 @@ module.exports = class ImportEntries {
11491149
// log('Published entries successfully in ' +);
11501150
})
11511151
.catch((error) => {
1152-
addlogs(this.config, `Failed to publish few entries in ${lang} ${util.formatError(error)}`, 'error');
1152+
addlogs(this.config, `Failed to publish few entries in ${lang} ${formatError(error)}`, 'error');
11531153
});
11541154
},
11551155
{
@@ -1160,7 +1160,7 @@ module.exports = class ImportEntries {
11601160
return resolve();
11611161
})
11621162
.catch((error) => {
1163-
addlogs(this.config, `Failed to publish entries ${util.formatError(error)}`, 'error');
1163+
addlogs(this.config, `Failed to publish entries ${formatError(error)}`, 'error');
11641164
});
11651165
});
11661166
}

0 commit comments

Comments
 (0)