diff --git a/docs_v1.0/doc_wasm/index.html b/docs_v1.0/doc_wasm/index.html index 7121e38..9e9c960 100644 --- a/docs_v1.0/doc_wasm/index.html +++ b/docs_v1.0/doc_wasm/index.html @@ -70,13 +70,15 @@ async function loadDoc(name) { if (!resp.ok) throw new Error('HTTP ' + resp.status); const md = await resp.text(); if (!wasm) throw new Error('WASM not initialized'); - el.innerHTML = wasm.render(md); - document.querySelectorAll('.sidebar a.module-link').forEach(a => a.classList.remove('active')); - const link = document.querySelector('.sidebar a[data-module="' + name + '"]'); + var html = wasm.render(md); + if (html.length === 0) throw new Error('WASM render returned empty HTML'); + el.innerHTML = html; + document.querySelectorAll('.sidebar a.module-link').forEach(function(a) { a.classList.remove('active'); }); + var link = document.querySelector('.sidebar a[data-module="' + name + '"]'); if (link) link.classList.add('active'); history.pushState(null, '', '#' + name); } catch(e) { - el.innerHTML = '

Error: ' + e.message + '

'; + el.innerHTML = '

Error: ' + e.message + '

' + e.stack + '
'; } } @@ -99,9 +101,9 @@ async function init() { window.location.reload(); }; var hash = location.hash.slice(1); - loadDoc(hash || '01_auth'); + await loadDoc(hash || '01_auth'); } catch(e) { - el.innerHTML = '

Init error: ' + e.message + '

'; + el.innerHTML = '

Init error: ' + e.message + '

' + e.stack + '
'; } }