@5minds/node-red-contrib-processcube 1.11.0 → 1.11.1
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/externaltask-error.html +8 -3
- package/externaltask-error.js +17 -8
- package/package.json +1 -1
package/externaltask-error.html
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
defaults: {
|
6
6
|
name: { value: '' },
|
7
7
|
error: { value: '' },
|
8
|
+
message: { value: '' },
|
8
9
|
},
|
9
10
|
inputs: 1,
|
10
11
|
outputs: 1,
|
@@ -25,6 +26,10 @@
|
|
25
26
|
<label for="node-input-error"><i class="fa fa-tag"></i> Error Code</label>
|
26
27
|
<input type="text" id="node-input-error" placeholder="Error Code of ExternalTask" />
|
27
28
|
</div>
|
29
|
+
<div class="form-row">
|
30
|
+
<label for="node-input-message"><i class="fa fa-tag"></i> Error Message</label>
|
31
|
+
<input type="text" id="node-input-message" placeholder="Error Message of ExternalTask" />
|
32
|
+
</div>
|
28
33
|
</script>
|
29
34
|
|
30
35
|
<script type="text/markdown" data-help-name="externaltask-error">
|
@@ -35,9 +40,9 @@ handling within _Error-Boundary-Events_.
|
|
35
40
|
## Inputs
|
36
41
|
|
37
42
|
: msg (Object) : Passed as `ErrorDetails` to the engine
|
38
|
-
: Error (string) : From the configuration
|
39
|
-
: Message (string) : The caught exception message
|
40
|
-
: StackTrace (string) : The stack trace of the exception
|
43
|
+
: Error (string) : From the configuration or from `msg.errorCode` or `msg.error.code`
|
44
|
+
: Message (string) : The caught exception message or `msg.errorMessage` or `msg.error.message`
|
45
|
+
: StackTrace (string) : The stack trace of the exception!
|
41
46
|
|
42
47
|
### References
|
43
48
|
|
package/externaltask-error.js
CHANGED
@@ -16,17 +16,26 @@ module.exports = function (RED) {
|
|
16
16
|
node.error('Error: The message did not contain the required etw_input_node_id.');
|
17
17
|
} else {
|
18
18
|
let msgError = msg.error;
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
let errorCode = config.error;
|
20
|
+
let errorMessage = config.message;
|
21
|
+
let errorDetails = RED.util.encodeObject(msg);
|
22
|
+
|
23
|
+
if (msgError) {
|
24
|
+
if (msgError.code) {
|
25
|
+
errorCode = msgError.code;
|
26
|
+
errorMessage = msgError.message;
|
27
|
+
}
|
28
|
+
} else if (msg.errorCode) {
|
29
|
+
errorCode = msg.errorCode;
|
30
|
+
errorMessage = msg.errorMessage;
|
22
31
|
}
|
23
32
|
|
24
|
-
const error = new Error(
|
25
|
-
error.errorCode =
|
26
|
-
error.errorDetails =
|
33
|
+
const error = new Error(errorMessage);
|
34
|
+
error.errorCode = errorCode;
|
35
|
+
error.errorDetails = errorDetails;
|
27
36
|
|
28
|
-
msg.errorCode =
|
29
|
-
msg.errorMessage =
|
37
|
+
msg.errorCode = errorCode;
|
38
|
+
msg.errorMessage = errorMessage;
|
30
39
|
|
31
40
|
node.log(`handle-${flowNodeInstanceId}: *flowNodeInstanceId* '${flowNodeInstanceId}' with *msg._msgid* '${msg._msgid}'`);
|
32
41
|
|