浏览代码

fix call with error handler not throwing on call itself

master
peter 5 年前
父节点
当前提交
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
 {
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 查看文件

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

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)

正在加载...
取消
保存