@mhubcloud/tms_core 3.0.1-beta.0 → 3.0.2-beta.0

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.
package/dist/index.js CHANGED
@@ -251,11 +251,13 @@ async function defaultPublisher(azureFunctionContext, serviceBusMessage, source,
251
251
  if (result.status === "rejected") {
252
252
  if (result.reason instanceof Error) {
253
253
  logException(azureFunctionContext.log, result.reason);
254
+ throw result.reason;
254
255
  } else {
255
256
  logException(
256
257
  azureFunctionContext.log,
257
258
  new Error(result.reason)
258
259
  );
260
+ throw new Error(result.reason);
259
261
  }
260
262
  }
261
263
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mhubcloud/tms_core",
3
- "version": "3.0.1-beta.0",
3
+ "version": "3.0.2-beta.0",
4
4
  "description": "Core function for mHub Cloud TMS publishers",
5
5
  "homepage": "https://mhubcloud.com/",
6
6
  "license": "Apache 2.0",
@@ -11,7 +11,7 @@ import * as utils from './utils/utils';
11
11
  * @deprecated Udelat novou metodu, ktera bude spravne a bude inicializovat classu
12
12
  * @param azureFunctionContext Azure Function Context
13
13
  * @param serviceBusMessage Array of messages received from Event Hub
14
- * @param source Name of the publisher (it's folder name in which it's implemented)
14
+ * @param source Name of the publisher (name of the folder in which it is implemented)
15
15
  * @param platformPublisher Publisher implementation instance (from <publisher>/publisher.js)
16
16
  * @param trigger
17
17
  */
@@ -37,11 +37,13 @@ export async function defaultPublisher(
37
37
  if (result.status === 'rejected') {
38
38
  if (result.reason instanceof Error) {
39
39
  utils.logException(azureFunctionContext.log, result.reason);
40
+ throw result.reason;
40
41
  } else {
41
42
  utils.logException(
42
43
  azureFunctionContext.log,
43
44
  new Error(result.reason as Error['message']),
44
45
  );
46
+ throw new Error(result.reason as Error['message']);
45
47
  }
46
48
  }
47
49
  }
package/tests/Piano.js CHANGED
@@ -63,8 +63,8 @@ async function test(serviceBusMessage) {
63
63
  );
64
64
  } catch (err) {
65
65
  assert.equal(
66
- err.toString(),
67
- 'FetchError: request to https://xxxxx.xiti.com/?s=12345&idclient=1657003393413.319297501&ref=https://crossmasters.com/ failed, reason: getaddrinfo ENOTFOUND xxxxx.xiti.com',
66
+ err.cause.toString(),
67
+ 'Error: getaddrinfo ENOTFOUND xxxxx.xiti.com',
68
68
  );
69
69
  }
70
70
  }