@crowdin/app-project-module 0.28.0-7 → 0.28.0-8

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.
@@ -43,6 +43,7 @@ const index_1 = require("./index");
43
43
  const connection_1 = require("./connection");
44
44
  const storage_1 = require("../storage");
45
45
  const defaults_1 = require("./defaults");
46
+ const util_1 = require("../util");
46
47
  const HookEvents = {
47
48
  ALL: ['file.translated', 'file.approved'],
48
49
  TRANSLATED: ['file.translated'],
@@ -288,14 +289,20 @@ function consumer(channel, config, integration) {
288
289
  return function (msg) {
289
290
  var _a;
290
291
  return __awaiter(this, void 0, void 0, function* () {
291
- if (msg) {
292
+ if (!msg) {
293
+ return;
294
+ }
295
+ try {
292
296
  const data = JSON.parse(msg.content.toString());
293
297
  const urlParam = (_a = integration.webhooks) === null || _a === void 0 ? void 0 : _a.urlParam;
294
298
  const webhookUrlParam = data.query[urlParam];
295
299
  const webhookData = yield prepareWebhookData(config, integration, webhookUrlParam, 'integration');
296
300
  yield updateCrowdinFromWebhookRequest(integration, webhookData, data);
297
- channel.ack(msg);
298
301
  }
302
+ catch (e) {
303
+ (0, util_1.logError)(e, config.onError);
304
+ }
305
+ channel.ack(msg);
299
306
  });
300
307
  };
301
308
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowdin/app-project-module",
3
- "version": "0.28.0-7",
3
+ "version": "0.28.0-8",
4
4
  "description": "Module that generates for you all common endpoints for serving standalone Crowdin App",
5
5
  "main": "out/index.js",
6
6
  "types": "out/index.d.ts",