v2.4.6 respond with 500 on unhandled exception from user's HTTP handler

This commit is contained in:
AJ ONeal 2018-08-24 23:53:29 -06:00
parent ca2e5cdb99
commit efd7693dcd
2 changed files with 8 additions and 1 deletions

View File

@ -65,6 +65,13 @@ module.exports.create = function (opts) {
} catch(e) { } catch(e) {
console.error("[error] [greenlock.app] Your HTTP handler had an uncaught error:"); console.error("[error] [greenlock.app] Your HTTP handler had an uncaught error:");
console.error(e); console.error(e);
try {
res.statusCode = 500;
res.end("Internal Server Error: [Greenlock] HTTP exception logged for user-provided handler.");
} catch(e) {
// ignore
// (headers may have already been sent, etc)
}
} }
}) })
); );

View File

@ -1,6 +1,6 @@
{ {
"name": "greenlock-express", "name": "greenlock-express",
"version": "2.4.5", "version": "2.4.6",
"description": "Free SSL and managed or automatic HTTPS for node.js with Express, Koa, Connect, Hapi, and all other middleware systems.", "description": "Free SSL and managed or automatic HTTPS for node.js with Express, Koa, Connect, Hapi, and all other middleware systems.",
"main": "index.js", "main": "index.js",
"homepage": "https://git.coolaj86.com/coolaj86/greenlock-express.js", "homepage": "https://git.coolaj86.com/coolaj86/greenlock-express.js",