From 09477e502b5b3e0a81aa66f3b3743616554ddb62 Mon Sep 17 00:00:00 2001 From: cel Date: Sun, 19 Mar 2017 15:27:57 -0400 Subject: fix some error handling --- lib/serve.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/serve.js') 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( -- cgit v1.2.3