feat: optimize framework add error catch(only log)

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2020-03-24 13:27:11 +08:00
parent 5844ca9e7d
commit cbb73b451f
10 changed files with 191 additions and 99 deletions

View File

@ -10,12 +10,14 @@ export abstract class TextWebSocketFrameHandlerAdapter {
acceptInboundMessage: (msg: any) => {
return TextWebSocketFrameMatcher.match(msg)
},
channelRead0: this.channelRead0.bind(this)
channelRead0: this.channelRead0.bind(this),
exceptionCaught: this.exceptionCaught.bind(this)
})
this._Handler = new TextWebSocketFrameHandlerAdapterImpl();
}
abstract userEventTriggered(ctx: any, evt: any);
abstract channelRead0(ctx: any, msg: any);
abstract exceptionCaught(ctx: any, cause: Error);
getHandler() {
return this._Handler;
}