chore: less verbose invalid msgs

This commit is contained in:
Ricardo Arturo Cabral Mejía 2023-01-29 23:26:19 -05:00
parent abd83386e2
commit 48ca4fd9bf

View File

@ -195,7 +195,7 @@ export class WebSocketAdapter extends EventEmitter implements IWebSocketAdapter
console.error(`web-socket-adapter: abort from client ${this.clientId} (${this.getClientAddress()})`)
} else if (error.name === 'SyntaxError' || error.name === 'ValidationError') {
if (typeof (error as any).annotate === 'function') {
console.error(`web-socket-adapter: invalid message client ${this.clientId} (${this.getClientAddress()}):`, (error as any).annotate())
debug('invalid message client %s (%s): %o', this.clientId, this.getClientAddress(), (error as any).annotate())
} else {
console.error(`web-socket-adapter: malformed message from client ${this.clientId} (${this.getClientAddress()}):`, error.message)
}