diff --git a/lib/modules/webserver/server.js b/lib/modules/webserver/server.js index bea969cb..2a921e29 100644 --- a/lib/modules/webserver/server.js +++ b/lib/modules/webserver/server.js @@ -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([ diff --git a/lib/modules/webserver/templates/embark-building-placeholder.html.ejs b/lib/modules/webserver/templates/embark-building-placeholder.html.ejs index 4785d8e4..4e77c691 100644 --- a/lib/modules/webserver/templates/embark-building-placeholder.html.ejs +++ b/lib/modules/webserver/templates/embark-building-placeholder.html.ejs @@ -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() } }); - \ No newline at end of file +