node-red-contrib-remote 2.0.1 → 2.0.2

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/README.md CHANGED
@@ -36,6 +36,9 @@ You will find more information on [www.remote-red-com](https://www.remote-red.co
36
36
 
37
37
  ## Version History
38
38
 
39
+ Version 2.0.2
40
+ - Crash on Node-RED startup fixed, extended error reporting
41
+
39
42
  Version 2.0.1
40
43
  - Possible bug on network connection fixed
41
44
 
@@ -102,7 +102,7 @@ module.exports = function(RED) {
102
102
  return new Promise((resolve, reject) => {
103
103
  // Is this instance banned?
104
104
  if ( node.instanceIsBanned ) {
105
- reject();
105
+ reject(new Error('Instance banned'));
106
106
  }
107
107
 
108
108
  // Create object with config values to send to server
@@ -141,10 +141,12 @@ module.exports = function(RED) {
141
141
  })
142
142
  .catch((error) => {
143
143
  // Log error
144
- node.error('requestInstanceSlot: ' + commons.getNetworkErrorString(error))
144
+ node.error('requestInstanceSlot: ' + commons.getNetworkErrorString(error));
145
+ node.error(error);
145
146
  if ( commons.getNetworkErrorCustomString(error) !== undefined) {
146
147
  node.error(commons.getNetworkErrorCustomString(error));
147
148
  }
149
+ commons.reportError(error, node, 'requestInstanceSlot');
148
150
 
149
151
  // Wenn gebannt -> Merken
150
152
  if ( error.response && error.response.status ) {
@@ -156,14 +158,20 @@ module.exports = function(RED) {
156
158
 
157
159
  // Set status
158
160
  if (!node.instanceIsBanned) setStatus(node, {fill:"red",shape:"dot",text:"remote-access.status.commerror"});
159
- reject();
161
+
162
+ // Resolve as error is handled
163
+ resolve();
160
164
  });
161
165
  });
162
166
  }
163
167
 
164
168
  async function tryConnect(node) {
165
169
  // Request new instance slot and connect ssh
166
- await requestInstanceSlot(node)
170
+ try {
171
+ await requestInstanceSlot(node)
172
+ } catch (error) {
173
+ commons.reportError(error, node, 'tryConnect');
174
+ }
167
175
 
168
176
  // Create timer to check if ssh process still serving in 10 seconds
169
177
  node.checkservingtimeout = setTimeout(checkServing, 1000*10, node);
@@ -80,6 +80,16 @@ module.exports = {
80
80
  errorString = `Error during DNS queries. Please check Internet connection on your Node-RED server. Please check if a firewall blocks your DNS queries.`;
81
81
  }
82
82
  return errorString;
83
+ },
84
+
85
+ reportError: function(error, node, caller) {
86
+ if (error instanceof AggregateError) {
87
+ error.errors.forEach(errorElem => {
88
+ this.reportError(errorElem, node, caller);
89
+ });
90
+ } else {
91
+ node.error(`${caller}: ${error.code}: ${(error.stack !== undefined) ? error.stack : error.message}`);
92
+ }
83
93
  }
84
94
 
85
95
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-remote",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Remote-RED is an ecosystem to bring remote access, push notification and geofencing to Node-RED. There are also additional functions like directly answer on a notification and homescreen widgets.",
5
5
  "author": "Thorsten Heilmann",
6
6
  "license": "GPL-3.0",
@@ -13,7 +13,7 @@
13
13
  }
14
14
  },
15
15
  "dependencies": {
16
- "axios": "^1.7.2",
16
+ "axios": "^1.8.1",
17
17
  "internal-ip": "^6.1.0",
18
18
  "limiter": "^1.1.5",
19
19
  "path": "^0.12.7",