@tchain/tcabci-read-js-client 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/client.js CHANGED
@@ -24,7 +24,7 @@ export default class TCAbciClient {
24
24
  subscribed = false
25
25
  subscribedAddresses = []
26
26
  connected = false
27
- version = 'v2.0.1'
27
+ version = 'v2.0.2'
28
28
  errorCb = null
29
29
  listenCb = null
30
30
  ws = null
package/errors.js CHANGED
@@ -17,12 +17,13 @@ export class FetchError extends Error {
17
17
  code = -1
18
18
  response = {}
19
19
 
20
- constructor(props, code = -1) {
21
- super(props)
20
+ constructor(message, code = -1) {
21
+ super(message)
22
+ this.message = message
22
23
  this.code = code
23
24
  this.response = {
24
25
  status: code,
25
- statusText: Array.isArray(props) ? props[0] : props,
26
+ statusText: message,
26
27
  }
27
28
  }
28
29
  }
package/errors_test.js ADDED
@@ -0,0 +1,11 @@
1
+ import { FetchError } from './errors.js'
2
+ import unitJS from 'unit.js'
3
+
4
+ describe('Errors', () => {
5
+ it('FetchError', () => {
6
+ const err = new FetchError('err1', 1)
7
+
8
+ unitJS.assert.equal(err.message, 'err1')
9
+ unitJS.assert.equal(err.code, 1)
10
+ })
11
+ })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tchain/tcabci-read-js-client",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "TransferChain Fastest Read Network WebSocket Client",
5
5
  "main": "client.js",
6
6
  "type": "module",