瀏覽代碼

fix call with error handler not throwing on call itself

master
peter 4 年之前
父節點
當前提交
9901785c80
共有 3 個檔案被更改,包括 3 行新增5 行删除
  1. 1
    1
      package.json
  2. 1
    0
      src/Frontend.ts
  3. 1
    4
      test/Test.ts

+ 1
- 1
package.json 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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…
取消
儲存