From 9901785c809fd70511e738bccbe66b7523068afc Mon Sep 17 00:00:00 2001 From: peter Date: Tue, 25 Feb 2020 18:10:23 +0100 Subject: [PATCH] fix call with error handler not throwing on call itself --- package.json | 2 +- src/Frontend.ts | 1 + test/Test.ts | 5 +---- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 6fbf3c1..2954456 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rpclibrary", - "version": "1.8.1", + "version": "1.8.2", "description": "rpclibrary is a websocket on steroids!", "main": "./js/Index.js", "repository": { diff --git a/src/Frontend.ts b/src/Frontend.ts index 66cd9de..da202d1 100644 --- a/src/Frontend.ts +++ b/src/Frontend.ts @@ -111,6 +111,7 @@ export class RPCSocket implements I.Socket{ return await this.socket.call.apply(this.socket, [rpcname, ...args]) }catch(e){ this.emit('error', e) + throw e } } diff --git a/test/Test.ts b/test/Test.ts index 6c9e18e..8805e69 100644 --- a/test/Test.ts +++ b/test/Test.ts @@ -614,10 +614,7 @@ describe("attaching handlers before connecting", ()=>{ }) sock.connect().then(_ => { - sock.call("unknownRPC123", "AAAAA").catch(e => { - console.log("unexpected call catch clause"); - done(e) - }) + sock.call("unknownRPC123", "AAAAA").catch(e => { /* ignore */}) }).catch(e => { console.log("unexpected connect catch clause"); done(e)