Skip to content

Commit

Permalink
bluwy's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Elie committed Feb 17, 2023
1 parent 0ae2104 commit 84c070a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/vite/src/node/server/ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,17 @@ export function createWebSocketServer(
const client = getSocketClient(socket)
listeners.forEach((listener) => listener(parsed.data, client))
})
socket.on('error', (err) => {
config.logger.error(`${colors.red(`ws proxy error:`)}\n${err.stack}`, {
timestamp: true,
error: err,
})
})
socket.send(JSON.stringify({ type: 'connected' }))
if (bufferedError) {
socket.send(JSON.stringify(bufferedError))
bufferedError = null
}
socket.on('error', (e) => {
config.logger.info(`WebSocket error:\n${e.stack || e.message}`)
})
})

wss.on('error', (e: Error & { code: string }) => {
Expand Down

0 comments on commit 84c070a

Please sign in to comment.