Ignore EPIPE exception on Windows when reloading demo client
Whenever the demo is reloaded on Windows the demo server crashes. This just ignores the error as I tried logging and adding try/catch around all interactions with the websocket and couldn't narrow it down.
This commit is contained in:
@@ -185,4 +185,12 @@ function startServer() {
|
||||
app.listen(port, host, 0);
|
||||
}
|
||||
|
||||
// HACK: There is an EPIPE error thrown when reloading a page. This only seems to happen on Windows
|
||||
// and it's unclear why it happens. Suppressing the error here since this is just the demo server.
|
||||
process.on('uncaughtException', (error) => {
|
||||
if (process.platform === 'win32' && error.message === 'read EPIPE') {
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = startServer;
|
||||
|
||||
Reference in New Issue
Block a user