Permalink
Browse files

Merge pull request #814 from samuelmaddock/swarm-debugger-error

Render swarm debugger error in view
  • Loading branch information...
pfrazee committed Jan 12, 2018
2 parents 7c56702 + 13d26f2 commit 55587e3f0070327d78d314cec3e51f270fcdba74
Showing with 16 additions and 1 deletion.
  1. +16 −1 app/builtin-pages/views/swarm-debugger.js
@@ -10,7 +10,13 @@ var peers = []
setup()
async function setup () {
archiveKey = await parseURL()
try {
archiveKey = await parseURL()
} catch (e) {
renderUsage(e.message)
return
}
render()
updatePeers()
@@ -79,6 +85,15 @@ function updatePeers () {
`)
}
function renderUsage (err) {
yo.update(document.querySelector('main'), yo`
<main>
<h1>${err}</h1>
<h2>A valid dat URL is required in the URL path.</h2>
</main>
`)
}
function onLog ({args}) {
document.querySelector('.log').appendChild(yo`<div>${args.join('')}</div>`)
}

0 comments on commit 55587e3

Please sign in to comment.