@mhubcloud/tms_core 3.0.1 → 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 +2 -0
- package/package.json +1 -1
- package/src/defaultPublisher.ts +3 -1
- package/tests/Piano.js +2 -2
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
package/src/defaultPublisher.ts
CHANGED
|
@@ -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 (
|
|
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
|
-
'
|
|
66
|
+
err.cause.toString(),
|
|
67
|
+
'Error: getaddrinfo ENOTFOUND xxxxx.xiti.com',
|
|
68
68
|
);
|
|
69
69
|
}
|
|
70
70
|
}
|