libshv-js 3.6.2 → 3.6.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/ws-client.ts +2 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libshv-js",
3
- "version": "3.6.2",
3
+ "version": "3.6.4",
4
4
  "description": "Typescript implementation of libshv",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
package/src/ws-client.ts CHANGED
@@ -104,8 +104,6 @@ class RpcError extends Error {
104
104
  }
105
105
  }
106
106
 
107
- class ProtocolError extends Error {}
108
-
109
107
  class InvalidRequest extends RpcError {}
110
108
  class MethodNotFound extends RpcError {}
111
109
  class InvalidParams extends RpcError {}
@@ -195,7 +193,8 @@ class WsClient {
195
193
  return rpcMsg.value[RPC_MESSAGE_RESULT];
196
194
  }
197
195
 
198
- return new ProtocolError('Response included neither result nor error');
196
+ // If both result and error are missing, the result is implicitly Null.
197
+ // https://silicon-heaven.github.io/shv-doc/rpcmessage.html#response
199
198
  })());
200
199
  // eslint-disable-next-line @typescript-eslint/no-array-delete
201
200
  delete this.rpcHandlers[Number(requestId)];
@@ -263,7 +262,6 @@ class WsClient {
263
262
  dgram[ix++] = msgDatum;
264
263
  }
265
264
 
266
- this.logDebug(`sending ${dgram.length} bytes of data`);
267
265
  this.websocket.send(dgram.buffer);
268
266
  }
269
267
  }