From 932500d6d44c7aba8f2f1eb077365ed0ee504d2c Mon Sep 17 00:00:00 2001 From: cel Date: Mon, 28 Jan 2019 19:24:50 -1000 Subject: Try to crash less --- lib/serve.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/serve.js b/lib/serve.js index 9224f28..e4f2c9e 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -1605,7 +1605,10 @@ function catchHTMLError() { return function (abort, cb) { if (ended) return cb(ended) read(abort, function (end, data) { - if (!end || end === true) return cb(end, data) + if (!end || end === true) { + try { return cb(end, data) } + catch(e) { return console.trace(e) } + } ended = true cb(null, u.renderError(end).outerHTML) }) -- cgit v1.2.3