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,6 +1,6 @@
1 1
 {
2 2
   "name": "rpclibrary",
3
-  "version": "1.8.1",
3
+  "version": "1.8.2",
4 4
   "description": "rpclibrary is a websocket on steroids!",
5 5
   "main": "./js/Index.js",
6 6
   "repository": {

+ 1
- 0
src/Frontend.ts View File

@@ -111,6 +111,7 @@ export class RPCSocket implements I.Socket{
111 111
             return await this.socket.call.apply(this.socket, [rpcname, ...args])
112 112
         }catch(e){
113 113
             this.emit('error', e)
114
+            throw e
114 115
         }
115 116
     }
116 117
 

+ 1
- 4
test/Test.ts View File

@@ -614,10 +614,7 @@ describe("attaching handlers before connecting", ()=>{
614 614
         })
615 615
 
616 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 618
         }).catch(e => {
622 619
             console.log("unexpected connect catch clause");
623 620
             done(e)

Loading…
Cancel
Save