@gregoriusrippenstein/node-red-contrib-nodedev 0.2.3 → 0.2.4
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/nodes/20-pkg-file.html +1 -0
- package/nodes/lib/tarhelpers.js +1 -0
- package/nodes/templates/tmpl.js +20 -3
- package/package.json +1 -1
package/nodes/20-pkg-file.html
CHANGED
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
<option value="xml">XML</option>
|
|
29
29
|
<option value="base64">Base64</option>
|
|
30
30
|
<option value="text">Text</option>
|
|
31
|
+
<option value="typescript">TypeScript</option>
|
|
31
32
|
</select>
|
|
32
33
|
<button type="button" id="node-pkgfile-expand-editor" class="red-ui-button red-ui-button-small"><i class="fa fa-expand"></i></button>
|
|
33
34
|
</div>
|
package/nodes/lib/tarhelpers.js
CHANGED
package/nodes/templates/tmpl.js
CHANGED
|
@@ -19,8 +19,25 @@ module.exports = function(RED) {
|
|
|
19
19
|
})
|
|
20
20
|
);
|
|
21
21
|
{{/node.bak2frtcomm}}
|
|
22
|
-
send
|
|
23
|
-
|
|
22
|
+
// How to send a status update
|
|
23
|
+
node.status({ fill: "green", shape: "ring", text: "status set" });
|
|
24
|
+
|
|
25
|
+
// Send a message and how to handle errors.
|
|
26
|
+
try {
|
|
27
|
+
try {
|
|
28
|
+
send(msg);
|
|
29
|
+
done();
|
|
30
|
+
} catch ( err ) {
|
|
31
|
+
// use node.error if the node might send subsequent messages
|
|
32
|
+
node.error("error occurred", { ...msg, error: err })
|
|
33
|
+
done();
|
|
34
|
+
}
|
|
35
|
+
} catch (err) {
|
|
36
|
+
// use done if the node won't send anymore messages for the
|
|
37
|
+
// message it received.
|
|
38
|
+
msg.error = err
|
|
39
|
+
done(err.message, msg)
|
|
40
|
+
}
|
|
24
41
|
});
|
|
25
42
|
}
|
|
26
43
|
|
|
@@ -49,7 +66,7 @@ module.exports = function(RED) {
|
|
|
49
66
|
} catch (err) {
|
|
50
67
|
console.error(err);
|
|
51
68
|
res.status(500).send(err.toString());
|
|
52
|
-
node.error("{{ node.name }}: " + RED._("{{ node.name }}.label.submissionfailed") + ": " + err.toString())
|
|
69
|
+
node.error("{{ node.name }}: " + RED._("{{ node.name }}.label.submissionfailed") + ": " + err.toString(), { error: err })
|
|
53
70
|
}
|
|
54
71
|
} else {
|
|
55
72
|
res.sendStatus(404);
|