node-red-contrib-mobius-flow-base 3.1.2 → 3.1.4-beta.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/dist/engine-api-calls.js +1 -1
- package/dist/engine-api-client.d.ts +5 -4
- package/dist/engine-api-client.js +13 -10
- package/dist/engine-websocket.js +8 -3
- package/dist/node-red-ui-funcs.js +9 -9
- package/dist/nodes/mobius-change-admin-password.js +2 -2
- package/dist/nodes/mobius-clear-resource.js +4 -4
- package/dist/nodes/mobius-connection.js +7 -7
- package/dist/nodes/mobius-discover.js +15 -4
- package/dist/nodes/mobius-filter-by-rid-value.js +21 -5
- package/dist/nodes/mobius-get-multi-object.js +4 -4
- package/dist/nodes/mobius-get-multi-resource.js +4 -4
- package/dist/nodes/mobius-get-object.js +4 -4
- package/dist/nodes/mobius-get-resource.js +4 -4
- package/dist/nodes/mobius-send-dcmd.js +4 -4
- package/dist/nodes/mobius-set-multi-resource.js +4 -4
- package/dist/nodes/mobius-set-resource.js +8 -8
- package/package.json +1 -1
package/dist/engine-api-calls.js
CHANGED
|
@@ -110,7 +110,7 @@ class EngineApiCalls {
|
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
112
|
catch (err) {
|
|
113
|
-
throw `Failed to send broadcast command: ${err.code}, ${err.message ? err.message : ''}`;
|
|
113
|
+
throw `Failed to send broadcast command: ${err.code ? err.code : 'Unknown'}, ${err.message ? err.message : ''}`;
|
|
114
114
|
}
|
|
115
115
|
};
|
|
116
116
|
sendDirectCommand = async (uri, cid, commandData, timeout, callback) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AxiosInstance } from
|
|
2
|
-
import { EngineWebSocket } from
|
|
3
|
-
import { EngineApiCalls } from
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
import { EngineWebSocket } from "./engine-websocket";
|
|
3
|
+
import { EngineApiCalls } from "./engine-api-calls";
|
|
4
4
|
export declare class EngineApiClient extends EngineApiCalls {
|
|
5
5
|
private reloginInterval;
|
|
6
6
|
client: AxiosInstance | null;
|
|
@@ -15,7 +15,8 @@ export declare class EngineApiClient extends EngineApiCalls {
|
|
|
15
15
|
EngineWebSocket: EngineWebSocket;
|
|
16
16
|
private hostname;
|
|
17
17
|
private protocol;
|
|
18
|
-
|
|
18
|
+
private clientID;
|
|
19
|
+
constructor(protocol: "http" | "https", host: string, username: string, password: string);
|
|
19
20
|
private login;
|
|
20
21
|
private refresh;
|
|
21
22
|
close: () => void;
|
|
@@ -7,6 +7,7 @@ exports.EngineApiClient = void 0;
|
|
|
7
7
|
const axios_1 = __importDefault(require("axios"));
|
|
8
8
|
const engine_websocket_1 = require("./engine-websocket");
|
|
9
9
|
const engine_api_calls_1 = require("./engine-api-calls");
|
|
10
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
10
11
|
// new class
|
|
11
12
|
class EngineApiClient extends engine_api_calls_1.EngineApiCalls {
|
|
12
13
|
reloginInterval = null;
|
|
@@ -19,17 +20,19 @@ class EngineApiClient extends engine_api_calls_1.EngineApiCalls {
|
|
|
19
20
|
EngineWebSocket;
|
|
20
21
|
hostname;
|
|
21
22
|
protocol;
|
|
23
|
+
clientID;
|
|
22
24
|
constructor(protocol, host, username, password) {
|
|
23
25
|
super();
|
|
24
26
|
this.username = username;
|
|
25
27
|
this.password = password;
|
|
26
28
|
this.hostname = host;
|
|
27
29
|
this.protocol = protocol;
|
|
30
|
+
this.clientID = crypto_1.default.randomBytes(16).toString("hex");
|
|
28
31
|
const baseURL = `${this.protocol}://${this.hostname}/api/v1`;
|
|
29
32
|
this.client = axios_1.default.create({
|
|
30
33
|
baseURL: baseURL,
|
|
31
34
|
headers: {
|
|
32
|
-
|
|
35
|
+
"Content-Type": "application/json",
|
|
33
36
|
},
|
|
34
37
|
});
|
|
35
38
|
this.setApiClient(this.client);
|
|
@@ -42,15 +45,15 @@ class EngineApiClient extends engine_api_calls_1.EngineApiCalls {
|
|
|
42
45
|
this.login();
|
|
43
46
|
}
|
|
44
47
|
else {
|
|
45
|
-
console.log(
|
|
48
|
+
console.log("No username, password, host, or port provided. Not attempting to login to Mobius Engine API.");
|
|
46
49
|
clearInterval(this.reloginInterval);
|
|
47
50
|
this.reloginInterval = null;
|
|
48
51
|
}
|
|
49
52
|
// Add auth headers to all axios calls
|
|
50
53
|
this.client.interceptors.request.use((config) => {
|
|
51
|
-
if (!config.url?.endsWith(
|
|
54
|
+
if (!config.url?.endsWith("/auth/login")) {
|
|
52
55
|
if (this.tokens && config.headers) {
|
|
53
|
-
config.headers[
|
|
56
|
+
config.headers["Authorization"] = `Bearer ${this.tokens.token}`;
|
|
54
57
|
}
|
|
55
58
|
}
|
|
56
59
|
return config;
|
|
@@ -63,7 +66,7 @@ class EngineApiClient extends engine_api_calls_1.EngineApiCalls {
|
|
|
63
66
|
if (!error.response) {
|
|
64
67
|
// notify
|
|
65
68
|
}
|
|
66
|
-
if (!error.config.url?.endsWith(
|
|
69
|
+
if (!error.config.url?.endsWith("/auth/login")) {
|
|
67
70
|
console.log(`(${this.hostname}) -> Logged Out: ${error.response}`);
|
|
68
71
|
clearInterval(this.refreshLoop);
|
|
69
72
|
this.loggedIn = false;
|
|
@@ -76,11 +79,11 @@ class EngineApiClient extends engine_api_calls_1.EngineApiCalls {
|
|
|
76
79
|
this.EngineWebSocket = new engine_websocket_1.EngineWebSocket(this.hostname, this.protocol);
|
|
77
80
|
}
|
|
78
81
|
login = async () => {
|
|
79
|
-
console.log(`(${this.hostname}) -> Attempting Mobius Engine API Login`);
|
|
82
|
+
console.log(`(${this.hostname}) -> Attempting Mobius Engine API Login => ${this.clientID}`);
|
|
80
83
|
try {
|
|
81
84
|
const response = await this.client({
|
|
82
|
-
method:
|
|
83
|
-
url:
|
|
85
|
+
method: "post",
|
|
86
|
+
url: "/auth/login",
|
|
84
87
|
data: {
|
|
85
88
|
username: this.username,
|
|
86
89
|
password: this.password,
|
|
@@ -106,8 +109,8 @@ class EngineApiClient extends engine_api_calls_1.EngineApiCalls {
|
|
|
106
109
|
}
|
|
107
110
|
try {
|
|
108
111
|
const response = await this.client({
|
|
109
|
-
method:
|
|
110
|
-
url:
|
|
112
|
+
method: "post",
|
|
113
|
+
url: "/auth/refresh",
|
|
111
114
|
data: {
|
|
112
115
|
refreshToken: this.tokens.refreshToken,
|
|
113
116
|
},
|
package/dist/engine-websocket.js
CHANGED
|
@@ -34,10 +34,10 @@ class EngineWebSocket extends stream_1.EventEmitter {
|
|
|
34
34
|
console.log(`(${this.hostname}) -> Engine API Subscription WebSocket Client Connected`);
|
|
35
35
|
this.pingInterval = setInterval(this.sendPingMessage, 30000);
|
|
36
36
|
clearInterval(this.reconnectInterval);
|
|
37
|
-
this.
|
|
37
|
+
this.sendWebSocketMessage({
|
|
38
38
|
topic: 'authorize',
|
|
39
39
|
payload: `Bearer ${this.authToken}`,
|
|
40
|
-
})
|
|
40
|
+
});
|
|
41
41
|
this.pendingWebSocketMessageInterval = setInterval(() => {
|
|
42
42
|
for (let i = 0; i < this.pendingWebSocketMessages.length; i++) {
|
|
43
43
|
const pendingMessage = this.pendingWebSocketMessages.shift();
|
|
@@ -84,7 +84,12 @@ class EngineWebSocket extends stream_1.EventEmitter {
|
|
|
84
84
|
};
|
|
85
85
|
sendWebSocketMessage = (message) => {
|
|
86
86
|
if (this.webSocket?.readyState === ws_1.default.OPEN) {
|
|
87
|
-
|
|
87
|
+
try {
|
|
88
|
+
this.webSocket.send(JSON.stringify(message));
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
console.log(`(${this.hostname}) -> Error sending WS message`);
|
|
92
|
+
}
|
|
88
93
|
}
|
|
89
94
|
else {
|
|
90
95
|
this.pendingWebSocketMessages.push(message);
|
|
@@ -199,9 +199,9 @@ module.exports = {
|
|
|
199
199
|
}
|
|
200
200
|
return services;
|
|
201
201
|
} catch (err) {
|
|
202
|
-
throw `Error getting service list for Flows UI: ${
|
|
203
|
-
err.
|
|
204
|
-
}`;
|
|
202
|
+
throw `Error getting service list for Flows UI: ${
|
|
203
|
+
err.code ? err.code : 'Unknown'
|
|
204
|
+
}, ${err.message ? err.message : ''}`;
|
|
205
205
|
}
|
|
206
206
|
},
|
|
207
207
|
|
|
@@ -227,9 +227,9 @@ module.exports = {
|
|
|
227
227
|
}
|
|
228
228
|
return objectList;
|
|
229
229
|
} catch (err) {
|
|
230
|
-
throw `Error getting object list for Flows UI: ${
|
|
231
|
-
err.
|
|
232
|
-
}`;
|
|
230
|
+
throw `Error getting object list for Flows UI: ${
|
|
231
|
+
err.code ? err.code : 'Unknown'
|
|
232
|
+
}, ${err.message ? err.message : ''}`;
|
|
233
233
|
}
|
|
234
234
|
},
|
|
235
235
|
|
|
@@ -287,9 +287,9 @@ module.exports = {
|
|
|
287
287
|
}
|
|
288
288
|
return formattedObjectList;
|
|
289
289
|
} catch (err) {
|
|
290
|
-
throw `Error getting config objects list for Flows UI: ${
|
|
291
|
-
err.
|
|
292
|
-
}`;
|
|
290
|
+
throw `Error getting config objects list for Flows UI: ${
|
|
291
|
+
err.code ? err.code : 'Unknown'
|
|
292
|
+
}, ${err.message ? err.message : ''}`;
|
|
293
293
|
}
|
|
294
294
|
},
|
|
295
295
|
|
|
@@ -61,9 +61,9 @@ module.exports = function (RED) {
|
|
|
61
61
|
node.status({
|
|
62
62
|
fill: 'yellow',
|
|
63
63
|
shape: 'dot',
|
|
64
|
-
text:
|
|
64
|
+
text: `Error: ${err.code ? err.code : 'Unknown'}`,
|
|
65
65
|
});
|
|
66
|
-
node.error(`Mobius error setting admin password: ${err.code}, ${err.message ? err.message : ''}`);
|
|
66
|
+
node.error(`Mobius error setting admin password: ${err.code ? err.code : 'Unknown'}, ${err.message ? err.message : ''}`);
|
|
67
67
|
}
|
|
68
68
|
else {
|
|
69
69
|
node.status({
|
|
@@ -67,12 +67,12 @@ module.exports = function (RED) {
|
|
|
67
67
|
node.status({
|
|
68
68
|
fill: 'yellow',
|
|
69
69
|
shape: 'dot',
|
|
70
|
-
text:
|
|
70
|
+
text: `Error: ${err.code ? err.code : 'Unknown'}`,
|
|
71
71
|
});
|
|
72
72
|
node.error(
|
|
73
|
-
`Mobius error clearing resource priority: ${
|
|
74
|
-
err.
|
|
75
|
-
}`
|
|
73
|
+
`Mobius error clearing resource priority: ${
|
|
74
|
+
err.code ? err.code : 'Unknown'
|
|
75
|
+
}, ${err.message ? err.message : ''}`
|
|
76
76
|
);
|
|
77
77
|
if (node.detailedOutput === true) {
|
|
78
78
|
node.send([
|
|
@@ -108,7 +108,7 @@ module.exports = function (RED) {
|
|
|
108
108
|
this.apiClient.getHubId((err, hubId) => {
|
|
109
109
|
if (err) {
|
|
110
110
|
node.error(
|
|
111
|
-
`Mobius error getting hub ID: ${err.code}, ${
|
|
111
|
+
`Mobius error getting hub ID: ${err.code ? err.code : 'Unknown'}, ${
|
|
112
112
|
err.message ? err.message : ''
|
|
113
113
|
}`
|
|
114
114
|
);
|
|
@@ -117,9 +117,9 @@ module.exports = function (RED) {
|
|
|
117
117
|
this.apiClient.discover(node.hubId, (err, response) => {
|
|
118
118
|
if (err) {
|
|
119
119
|
node.error(
|
|
120
|
-
`Mobius error discovering service list: ${
|
|
121
|
-
err.
|
|
122
|
-
}`
|
|
120
|
+
`Mobius error discovering service list: ${
|
|
121
|
+
err.code ? err.code : 'Unknown'
|
|
122
|
+
}, ${err.message ? err.message : ''}`
|
|
123
123
|
);
|
|
124
124
|
} else {
|
|
125
125
|
node.serviceList = response.data;
|
|
@@ -807,9 +807,9 @@ module.exports = function (RED) {
|
|
|
807
807
|
})
|
|
808
808
|
.catch((err) => {
|
|
809
809
|
RED.log.warn(
|
|
810
|
-
`Get objects failed on service ${req.query.sid}: ${
|
|
811
|
-
err.
|
|
812
|
-
}`
|
|
810
|
+
`Get objects failed on service ${req.query.sid}: ${
|
|
811
|
+
err.code ? err.code : 'Unknown'
|
|
812
|
+
}, ${err.message ? err.message : ''}`
|
|
813
813
|
);
|
|
814
814
|
});
|
|
815
815
|
}
|
|
@@ -60,7 +60,10 @@ module.exports = function (RED) {
|
|
|
60
60
|
});
|
|
61
61
|
|
|
62
62
|
let parameters = {};
|
|
63
|
-
if (
|
|
63
|
+
if (
|
|
64
|
+
msg.payload.hasOwnProperty('rid') &&
|
|
65
|
+
msg.payload.hasOwnProperty('func')
|
|
66
|
+
) {
|
|
64
67
|
parameters = msg.payload;
|
|
65
68
|
parameters['uri'] = path;
|
|
66
69
|
} else {
|
|
@@ -71,16 +74,24 @@ module.exports = function (RED) {
|
|
|
71
74
|
node.status({
|
|
72
75
|
fill: 'yellow',
|
|
73
76
|
shape: 'dot',
|
|
74
|
-
text:
|
|
77
|
+
text: `Error: ${err.code ? err.code : 'Unknown'}`,
|
|
78
|
+
});
|
|
79
|
+
node.send({
|
|
80
|
+
...msg,
|
|
81
|
+
topic: path,
|
|
82
|
+
payload: { error: true, response: err },
|
|
75
83
|
});
|
|
76
|
-
node.send({ ...msg, topic: path, payload: { error: true, response: err } });
|
|
77
84
|
} else {
|
|
78
85
|
node.status({
|
|
79
86
|
fill: 'green',
|
|
80
87
|
shape: 'dot',
|
|
81
88
|
text: JSON.stringify(response.uri),
|
|
82
89
|
});
|
|
83
|
-
node.send({
|
|
90
|
+
node.send({
|
|
91
|
+
...msg,
|
|
92
|
+
topic: path,
|
|
93
|
+
payload: { error: false, response: response },
|
|
94
|
+
});
|
|
84
95
|
}
|
|
85
96
|
});
|
|
86
97
|
}
|
|
@@ -54,7 +54,10 @@ module.exports = function (RED) {
|
|
|
54
54
|
let rid = node.rid;
|
|
55
55
|
let limit = node.limit;
|
|
56
56
|
let func = node.func;
|
|
57
|
-
if (
|
|
57
|
+
if (
|
|
58
|
+
msg.hasOwnProperty('topic') &&
|
|
59
|
+
require('./validateURI')(msg.topic, 2)
|
|
60
|
+
) {
|
|
58
61
|
uri = msg.topic;
|
|
59
62
|
}
|
|
60
63
|
if (msg.hasOwnProperty('payload')) {
|
|
@@ -88,10 +91,17 @@ module.exports = function (RED) {
|
|
|
88
91
|
node.status({
|
|
89
92
|
fill: 'yellow',
|
|
90
93
|
shape: 'dot',
|
|
91
|
-
text:
|
|
94
|
+
text: `Error: ${err.code ? err.code : 'Unknown'}`,
|
|
92
95
|
});
|
|
93
96
|
if (node.detailedOutput === true) {
|
|
94
|
-
node.send([
|
|
97
|
+
node.send([
|
|
98
|
+
null,
|
|
99
|
+
{
|
|
100
|
+
...msg,
|
|
101
|
+
topic: uri,
|
|
102
|
+
payload: { error: true, response: err },
|
|
103
|
+
},
|
|
104
|
+
]);
|
|
95
105
|
}
|
|
96
106
|
} else {
|
|
97
107
|
node.status({
|
|
@@ -101,12 +111,18 @@ module.exports = function (RED) {
|
|
|
101
111
|
});
|
|
102
112
|
let uriList = [];
|
|
103
113
|
for (let lp = 0; lp < response.value.length; lp++) {
|
|
104
|
-
uriList.push(
|
|
114
|
+
uriList.push(
|
|
115
|
+
`${response.uri}/${response.value[lp].pid}/${response.value[lp].ins}`
|
|
116
|
+
);
|
|
105
117
|
}
|
|
106
118
|
if (node.detailedOutput === true) {
|
|
107
119
|
node.send([
|
|
108
120
|
{ ...msg, topic: uri, payload: uriList },
|
|
109
|
-
{
|
|
121
|
+
{
|
|
122
|
+
...msg,
|
|
123
|
+
topic: uri,
|
|
124
|
+
payload: { error: false, response: response },
|
|
125
|
+
},
|
|
110
126
|
]);
|
|
111
127
|
} else {
|
|
112
128
|
node.send({ ...msg, topic: uri, payload: uriList });
|
|
@@ -79,12 +79,12 @@ module.exports = function (RED) {
|
|
|
79
79
|
node.status({
|
|
80
80
|
fill: 'yellow',
|
|
81
81
|
shape: 'dot',
|
|
82
|
-
text:
|
|
82
|
+
text: `Error: ${err.code ? err.code : 'Unknown'}`,
|
|
83
83
|
});
|
|
84
84
|
node.error(
|
|
85
|
-
`Mobius error reading object: ${
|
|
86
|
-
err.
|
|
87
|
-
}`
|
|
85
|
+
`Mobius error reading object: ${
|
|
86
|
+
err.code ? err.code : 'Unknown'
|
|
87
|
+
}, ${err.message ? err.message : ''}`
|
|
88
88
|
);
|
|
89
89
|
})
|
|
90
90
|
.finally(() => {
|
|
@@ -88,12 +88,12 @@ module.exports = function (RED) {
|
|
|
88
88
|
node.status({
|
|
89
89
|
fill: 'yellow',
|
|
90
90
|
shape: 'dot',
|
|
91
|
-
text:
|
|
91
|
+
text: `Error: ${err.code ? err.code : 'Unknown'}`,
|
|
92
92
|
});
|
|
93
93
|
node.error(
|
|
94
|
-
`Mobius error reading resource: ${
|
|
95
|
-
err.
|
|
96
|
-
}`
|
|
94
|
+
`Mobius error reading resource: ${
|
|
95
|
+
err.code ? err.code : 'Unknown'
|
|
96
|
+
}, ${err.message ? err.message : ''}`
|
|
97
97
|
);
|
|
98
98
|
})
|
|
99
99
|
.finally(() => {
|
|
@@ -64,12 +64,12 @@ module.exports = function (RED) {
|
|
|
64
64
|
node.status({
|
|
65
65
|
fill: 'yellow',
|
|
66
66
|
shape: 'dot',
|
|
67
|
-
text:
|
|
67
|
+
text: `Error: ${err.code ? err.code : 'Unknown'}`,
|
|
68
68
|
});
|
|
69
69
|
node.error(
|
|
70
|
-
`Mobius error reading object: ${
|
|
71
|
-
err.
|
|
72
|
-
}`
|
|
70
|
+
`Mobius error reading object: ${
|
|
71
|
+
err.code ? err.code : 'Unknown'
|
|
72
|
+
}, ${err.message ? err.message : ''}`
|
|
73
73
|
);
|
|
74
74
|
if (node.detailedOutput === true) {
|
|
75
75
|
node.send([
|
|
@@ -61,12 +61,12 @@ module.exports = function (RED) {
|
|
|
61
61
|
node.status({
|
|
62
62
|
fill: 'yellow',
|
|
63
63
|
shape: 'dot',
|
|
64
|
-
text:
|
|
64
|
+
text: `Error: ${err.code ? err.code : 'Unknown'}`,
|
|
65
65
|
});
|
|
66
66
|
node.error(
|
|
67
|
-
`Mobius error reading resource : ${
|
|
68
|
-
err.
|
|
69
|
-
}`
|
|
67
|
+
`Mobius error reading resource : ${
|
|
68
|
+
err.code ? err.code : 'Unknown'
|
|
69
|
+
}, ${err.message ? err.message : ''}`
|
|
70
70
|
);
|
|
71
71
|
if (node.detailedOutput === true) {
|
|
72
72
|
node.send([
|
|
@@ -55,12 +55,12 @@ module.exports = function (RED) {
|
|
|
55
55
|
node.status({
|
|
56
56
|
fill: 'yellow',
|
|
57
57
|
shape: 'dot',
|
|
58
|
-
text:
|
|
58
|
+
text: `Error: ${err.code ? err.code : 'Unknown'}`,
|
|
59
59
|
});
|
|
60
60
|
node.error(
|
|
61
|
-
`Mobius error sending DCMD command: ${
|
|
62
|
-
err.
|
|
63
|
-
}`
|
|
61
|
+
`Mobius error sending DCMD command: ${
|
|
62
|
+
err.code ? err.code : 'Unknown'
|
|
63
|
+
}, ${err.message ? err.message : ''}`
|
|
64
64
|
);
|
|
65
65
|
node.send([
|
|
66
66
|
null,
|
|
@@ -69,12 +69,12 @@ module.exports = function (RED) {
|
|
|
69
69
|
node.status({
|
|
70
70
|
fill: 'yellow',
|
|
71
71
|
shape: 'dot',
|
|
72
|
-
text:
|
|
72
|
+
text: `Error: ${err.code ? err.code : 'Unknown'}`,
|
|
73
73
|
});
|
|
74
74
|
node.error(
|
|
75
|
-
`Mobius error writing multiple resources: ${
|
|
76
|
-
err.
|
|
77
|
-
}`
|
|
75
|
+
`Mobius error writing multiple resources: ${
|
|
76
|
+
err.code ? err.code : 'Unknown'
|
|
77
|
+
}, ${err.message ? err.message : ''}`
|
|
78
78
|
);
|
|
79
79
|
if (node.detailedOutput === true) {
|
|
80
80
|
node.send([
|
|
@@ -75,12 +75,12 @@ module.exports = function (RED) {
|
|
|
75
75
|
node.status({
|
|
76
76
|
fill: 'yellow',
|
|
77
77
|
shape: 'dot',
|
|
78
|
-
text:
|
|
78
|
+
text: `Error: ${err.code ? err.code : 'Unknown'}`,
|
|
79
79
|
});
|
|
80
80
|
node.error(
|
|
81
|
-
`Mobius error clearing resource priority: ${
|
|
82
|
-
err.
|
|
83
|
-
}`
|
|
81
|
+
`Mobius error clearing resource priority: ${
|
|
82
|
+
err.code ? err.code : 'Unknown'
|
|
83
|
+
}, ${err.message ? err.message : ''}`
|
|
84
84
|
);
|
|
85
85
|
if (node.detailedOutput === true) {
|
|
86
86
|
node.send([
|
|
@@ -144,12 +144,12 @@ module.exports = function (RED) {
|
|
|
144
144
|
node.status({
|
|
145
145
|
fill: 'yellow',
|
|
146
146
|
shape: 'dot',
|
|
147
|
-
text:
|
|
147
|
+
text: `Error: ${err.code ? err.code : 'Unknown'}`,
|
|
148
148
|
});
|
|
149
149
|
node.error(
|
|
150
|
-
`Mobius error writing resource: ${
|
|
151
|
-
err.
|
|
152
|
-
}`
|
|
150
|
+
`Mobius error writing resource: ${
|
|
151
|
+
err.code ? err.code : 'Unknown'
|
|
152
|
+
}, ${err.message ? err.message : ''}`
|
|
153
153
|
);
|
|
154
154
|
node.send([
|
|
155
155
|
null,
|