diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2019-01-28 19:24:50 -1000 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2019-01-28 19:36:02 -1000 |
commit | 932500d6d44c7aba8f2f1eb077365ed0ee504d2c (patch) | |
tree | 4d5da7e545a073b73b8b775ee00175620a3f0d41 /lib | |
parent | ba5b68142c6759e3e48ff2837c578a2deaa0ca8d (diff) | |
download | patchfoo-932500d6d44c7aba8f2f1eb077365ed0ee504d2c.tar.gz patchfoo-932500d6d44c7aba8f2f1eb077365ed0ee504d2c.zip |
Try to crash less
Diffstat (limited to 'lib')
-rw-r--r-- | lib/serve.js | 5 |
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) }) |