dcp-client 5.1.6 → 5.1.7

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.
@@ -192,7 +192,6 @@ function StandaloneWorker(options = {})
192
192
  debugging() && console.debug('Connected; ' + writeOrQueue.pendingWrites.length + ' pending messages.');
193
193
 
194
194
  writeOrQueue(null); /* drain pending */
195
-
196
195
  /* @todo Make this auto-detected /wg jul 2018
197
196
  * changeSerializer.bind(this)("/var/dcp/lib/serialize.js")
198
197
  */
@@ -304,11 +303,33 @@ function StandaloneWorker(options = {})
304
303
  debugging() && console.log("Worker relayed a message:", ev);
305
304
  });
306
305
 
306
+ /**
307
+ * Exclude certain socket errors from reporting.
308
+ * @Wes Please verify that the 5 error codes below should not be reported to a worker or a dcp-client.
309
+ * @param {Error} error
310
+ * @returns (boolean) -- true when error is reportable
311
+ */
312
+ const isErrorReportable = function standaloneWorker$$Worker$isErrorReportable (error)
313
+ {
314
+ switch(error.code)
315
+ {
316
+ case 'ECONNREFUSED': /* remote not listening - evaluator not running? */
317
+ case 'ECONNRESET': /* RST packet sent: remote closed - throttled? */
318
+ case 'ECONNABORTED': /* unexpectedly aborted by the other side */
319
+ case 'EPIPE':
320
+ case 'ETIMEDOUT':
321
+ debugging() && console.debug('Non-reportable error:', error)
322
+ return false;
323
+ default:
324
+ return true;
325
+ }
326
+ }
327
+
307
328
  /* Shutdown the stream(s) which are connected to the evaluator */
308
329
  shutdown = (e) => {
309
330
  clearBackoffInterval(connectTimer);
310
331
 
311
- if (e instanceof Error)
332
+ if ((e instanceof Error) && isErrorReportable(e))
312
333
  console.error(e);
313
334
  debugging('lifecycle') && console.debug('Shutting down evaluator connection ' + this.serial + '');
314
335
  try {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "dcp-client",
3
- "version": "5.1.6",
3
+ "version": "5.1.7",
4
4
  "dcp": {
5
- "version": "353e61c1189b2131d9dfa1e397a43fe9da830845",
5
+ "version": "47df7037b4ed314a5b1c34e58b9821375635bd0f",
6
6
  "repository": "git@gitlab.com:Distributed-Compute-Protocol/dcp.git"
7
7
  },
8
8
  "description": "Core libraries for accessing DCP network",