Quellcode durchsuchen

fix call with error handler not throwing on call itself

master
peter vor 4 Jahren
Ursprung
Commit
9901785c80
3 geänderte Dateien mit 3 neuen und 5 gelöschten Zeilen
  1. 1
    1
      package.json
  2. 1
    0
      src/Frontend.ts
  3. 1
    4
      test/Test.ts

+ 1
- 1
package.json Datei anzeigen

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 Datei anzeigen

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 Datei anzeigen

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)

Laden…
Abbrechen
Speichern