aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2019-01-28 19:24:50 -1000
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2019-01-28 19:36:02 -1000
commit932500d6d44c7aba8f2f1eb077365ed0ee504d2c (patch)
tree4d5da7e545a073b73b8b775ee00175620a3f0d41
parentba5b68142c6759e3e48ff2837c578a2deaa0ca8d (diff)
downloadpatchfoo-932500d6d44c7aba8f2f1eb077365ed0ee504d2c.tar.gz
patchfoo-932500d6d44c7aba8f2f1eb077365ed0ee504d2c.zip
Try to crash less
-rw-r--r--lib/serve.js5
1 files changed, 4 insertions, 1 deletions
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)
})