aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-03-19 15:27:57 -0400
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-03-19 15:27:57 -0400
commit09477e502b5b3e0a81aa66f3b3743616554ddb62 (patch)
tree7b27a99d09cff9ba6fa70943cbfdcd0ae5a77f01
parent4ab88e61d4d24f4e690a047d3316d7ab516db03c (diff)
downloadpatchfoo-09477e502b5b3e0a81aa66f3b3743616554ddb62.tar.gz
patchfoo-09477e502b5b3e0a81aa66f3b3743616554ddb62.zip
fix some error handling
-rw-r--r--lib/serve.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/serve.js b/lib/serve.js
index 1c36c44..cb100ac 100644
--- a/lib/serve.js
+++ b/lib/serve.js
@@ -189,7 +189,7 @@ Serve.prototype.respondSink = function (status, headers, cb) {
var self = this
if (status && headers) self.res.writeHead(status, headers)
return toPull(self.res, cb || function (err) {
- if (err) self.error(err)
+ if (err) self.app.error(err)
})
}
@@ -386,8 +386,9 @@ Serve.prototype.channel = function (channel) {
}
if (!this.app.sbot.query) return pull(
- pull.once(u.renderError(new Error('Missing ssb-query plugin').outerHTML)),
- self.respondSink(400, {'Content-Type': ctype('html')})
+ pull.once(u.renderError(new Error('Missing ssb-query plugin')).outerHTML),
+ this.wrapPage('#' + channel),
+ this.respondSink(400, {'Content-Type': ctype('html')})
)
pull(