`${this.configuration.uiServer.secure === true ? ApplicationProtocol.WSS : ApplicationProtocol.WS}://${this.configuration.uiServer.host}:${this.configuration.uiServer.port}`,
protocols
)
+ this.ws.onopen = openEvent => {
+ console.info('WebSocket opened', openEvent)
+ }
this.ws.onmessage = this.responseHandler.bind(this)
this.ws.onerror = errorEvent => {
console.error('WebSocket error: ', errorEvent)
const msg = JSON.stringify([uuid, procedureName, payload])
const sendTimeout = setTimeout(() => {
this.responseHandlers.delete(uuid)
- return reject(new Error(`Send request '${procedureName}' message timeout`))
+ return reject(new Error(`Send request '${procedureName}' message: connection timeout`))
}, 60000)
try {
this.ws.send(msg)
clearTimeout(sendTimeout)
}
} else {
- throw new Error(`Send request '${procedureName}' message: connection not opened`)
+ reject(new Error(`Send request '${procedureName}' message: connection closed`))
}
})
}
fetch('/config.json')
.then(response => response.json())
.then(config => {
+ app.config.errorHandler = (error, instance, info) => {
+ console.error('Error:', error)
+ console.info('Vue instance:', instance)
+ console.info('Error info:', info)
+ // TODO: Add code for UI notifications or other error handling logic
+ }
app.config.globalProperties.$UIClient = UIClient.getInstance(config)
app.use(router).mount('#app')
})