@mhubcloud/tms_core 3.4.4 → 3.4.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.
Files changed (2) hide show
  1. package/dist/index.js +13 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -359,6 +359,8 @@ function matchEvent(event, publisherEvent) {
359
359
  if (!paramMatch) {
360
360
  return false;
361
361
  }
362
+ } else if (publisherEventParam && !eventParam) {
363
+ return false;
362
364
  } else {
363
365
  throw new Error("Unexpected formatting in publisher configuration");
364
366
  }
@@ -431,13 +433,19 @@ async function defaultPublisher(azureFunctionContext, serviceBusMessage, source,
431
433
  if (result.status === "rejected") {
432
434
  if (result.reason instanceof Error) {
433
435
  const formattedError = formatError(result.reason);
434
- logException(new Error(formattedError.message));
436
+ logException(
437
+ azureFunctionContext.log,
438
+ new Error(formattedError.message)
439
+ );
435
440
  throw formattedError;
436
441
  } else {
437
442
  const formattedError = formatError(
438
443
  typeof result.reason === "object" ? JSON.stringify(result.reason) : result.reason
439
444
  );
440
- logException(new Error(formattedError.message));
445
+ logException(
446
+ azureFunctionContext.log,
447
+ new Error(formattedError.message)
448
+ );
441
449
  throw formattedError;
442
450
  }
443
451
  }
@@ -475,6 +483,7 @@ async function processMessage(message, log2, platformPublisher, trigger) {
475
483
  publishedAny = true;
476
484
  } else {
477
485
  logException(
486
+ log2,
478
487
  new Error(
479
488
  `The message has not been published. Source: ${platformPublisher.source}`
480
489
  )
@@ -483,6 +492,7 @@ async function processMessage(message, log2, platformPublisher, trigger) {
483
492
  }
484
493
  if (!publishedAny) {
485
494
  logException(
495
+ log2,
486
496
  new Error(
487
497
  "The message has not been published to any publisher configuration"
488
498
  )
@@ -891,7 +901,7 @@ var publisher = {
891
901
  Facebook: facebook,
892
902
  // eslint-disable-next-line @typescript-eslint/naming-convention
893
903
  CJ: cj,
894
- // eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-unnecessary-type-assertion
904
+ // eslint-disable-next-line @typescript-eslint/naming-convention
895
905
  GoogleAds: googleAds,
896
906
  // eslint-disable-next-line @typescript-eslint/naming-convention
897
907
  GoogleAnalytics4: googleAnalytics4,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mhubcloud/tms_core",
3
- "version": "3.4.4",
3
+ "version": "3.4.5",
4
4
  "description": "Core function for mHub Cloud TMS publishers",
5
5
  "homepage": "https://mhubcloud.com/",
6
6
  "license": "Apache 2.0",