try { var socket = new WebSocket('ws://localhost:808'); } catch (ex) { console.log(ex) // control does not reach here }
socket.onerror = (...args) => console.log('async error', ...args)