fix: disable server error

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2020-03-31 14:53:23 +08:00
parent ccaa268362
commit 328d93cd3f
7 changed files with 21 additions and 15 deletions

View File

@ -1,6 +1,6 @@
import { EventEmitter } from 'events'
import { Keys } from './constants'
import { Keys, ServerEvent } from './constants'
import { WebSocketHandlerAdapter } from "../netty"
import { HttpRequestHandler } from './httprequest'
import { TextWebSocketFrameHandler } from './text_websocket_frame'
@ -40,4 +40,7 @@ export class WebSocketHandler extends WebSocketHandlerAdapter {
msg.resetReaderIndex()
ctx.fireChannelRead(msg)
}
exceptionCaught(ctx: any, cause: Error) {
this.options.event.emit(ServerEvent.error, ctx, cause)
}
}