@crowdin/app-project-module 0.58.4 → 0.58.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -375,17 +375,23 @@ function getOnlyTranslatedOrApprovedFiles({ projectId, crowdinFiles, crowdinClie
375
375
  return __awaiter(this, void 0, void 0, function* () {
376
376
  (0, logger_1.log)(`Filtering files to process only ${onlyApproved ? 'approved' : 'translated'} files`);
377
377
  const filesInfo = yield Promise.all(Object.keys(crowdinFiles).map((fileId) => __awaiter(this, void 0, void 0, function* () {
378
- const res = yield crowdinClient.translationStatusApi
379
- .withFetchAll()
380
- .getFileProgress(projectId, Number(fileId));
381
- return {
382
- id: fileId,
383
- info: res.data.map((e) => e.data),
384
- };
378
+ try {
379
+ const res = yield crowdinClient.translationStatusApi
380
+ .withFetchAll()
381
+ .getFileProgress(projectId, Number(fileId));
382
+ return {
383
+ id: fileId,
384
+ info: res.data.map((e) => e.data),
385
+ };
386
+ }
387
+ catch (e) {
388
+ delete crowdinFiles[fileId];
389
+ (0, logger_1.logError)(e);
390
+ }
385
391
  })));
386
392
  const filteredFiles = {};
387
393
  Object.keys(crowdinFiles).forEach((fileId) => {
388
- const fileInfo = filesInfo.find((info) => info.id === fileId);
394
+ const fileInfo = filesInfo.find((info) => (info === null || info === void 0 ? void 0 : info.id) === fileId);
389
395
  if (!fileInfo) {
390
396
  return;
391
397
  }