webserver: Emit websocket outputError and show error on the landing page.
Whenever outputError is emitted by Ember, display error message on the landing page and stop the page from refreshing every four seconds. Refs: https://github.com/embark-framework/embark/issues/946
This commit is contained in:
parent
78c5055902
commit
34cafc77e8
|
@ -44,6 +44,11 @@ class Server {
|
|||
wss.clients.forEach(function (client) {
|
||||
client.send('outputDone');
|
||||
});
|
||||
self.events.on('outputError', () => {
|
||||
if (ws.readyState === WEB_SOCKET_STATE_OPEN) {
|
||||
return ws.send('outputError');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
async.waterfall([
|
||||
|
|
|
@ -30,7 +30,10 @@
|
|||
ws.addEventListener('message', (evt) => {
|
||||
if(evt.data === 'outputDone') {
|
||||
location.reload(true);
|
||||
} else if(evt.data === 'outputError') {
|
||||
document.getElementsByClassName("loading-msg")[0].innerHTML = "Error building dapp, please check console";
|
||||
window.stop()
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue