Browse Source

fix call with error handler not throwing on call itself

master
peter 4 years ago
parent
commit
9901785c80
3 changed files with 3 additions and 5 deletions
  1. 1
    1
      package.json
  2. 1
    0
      src/Frontend.ts
  3. 1
    4
      test/Test.ts

+ 1
- 1
package.json View File

1
 {
1
 {
2
   "name": "rpclibrary",
2
   "name": "rpclibrary",
3
-  "version": "1.8.1",
3
+  "version": "1.8.2",
4
   "description": "rpclibrary is a websocket on steroids!",
4
   "description": "rpclibrary is a websocket on steroids!",
5
   "main": "./js/Index.js",
5
   "main": "./js/Index.js",
6
   "repository": {
6
   "repository": {

+ 1
- 0
src/Frontend.ts View File

111
             return await this.socket.call.apply(this.socket, [rpcname, ...args])
111
             return await this.socket.call.apply(this.socket, [rpcname, ...args])
112
         }catch(e){
112
         }catch(e){
113
             this.emit('error', e)
113
             this.emit('error', e)
114
+            throw e
114
         }
115
         }
115
     }
116
     }
116
 
117
 

+ 1
- 4
test/Test.ts View File

614
         })
614
         })
615
 
615
 
616
         sock.connect().then(_ => {
616
         sock.connect().then(_ => {
617
-            sock.call("unknownRPC123", "AAAAA").catch(e => {
618
-                console.log("unexpected call catch clause");
619
-                done(e)
620
-            })
617
+            sock.call("unknownRPC123", "AAAAA").catch(e => { /* ignore */})
621
         }).catch(e => {
618
         }).catch(e => {
622
             console.log("unexpected connect catch clause");
619
             console.log("unexpected connect catch clause");
623
             done(e)
620
             done(e)

Loading…
Cancel
Save