Inform user if gh-pages wasm demo cannot be instantiated

This commit is contained in:
Niklas Fasching 2018-12-18 18:26:17 +01:00
parent 56d47aeb8f
commit 941f3ea520

View file

@ -83,7 +83,11 @@ convert="
const go = new Go(); const go = new Go();
WebAssembly WebAssembly
.instantiateStreaming(fetch('main.wasm'), go.importObject) .instantiateStreaming(fetch('main.wasm'), go.importObject)
.then((result) => go.run(result.instance)); .then((result) => go.run(result.instance),
(error) => {
const button = document.getElementById('run');
button.textContent = 'ERROR: (' + error + ')';
});
function initialized() { function initialized() {
const button = document.getElementById('run'); const button = document.getElementById('run');