From 1e446b67974311e7069b20c00e63630803497ed5 Mon Sep 17 00:00:00 2001 From: Greg Beaty Date: Wed, 9 Dec 2015 16:36:30 -0500 Subject: [PATCH] Add exception stack to error response if available --- .../Content/Node/entrypoint-http.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Microsoft.AspNet.NodeServices/Content/Node/entrypoint-http.js b/Microsoft.AspNet.NodeServices/Content/Node/entrypoint-http.js index b9478c2..153d94f 100644 --- a/Microsoft.AspNet.NodeServices/Content/Node/entrypoint-http.js +++ b/Microsoft.AspNet.NodeServices/Content/Node/entrypoint-http.js @@ -21,7 +21,12 @@ var server = http.createServer(function(req, res) { hasSentResult = true; if (errorValue) { res.statusCode = 500; - res.end(errorValue.toString()); + + if (errorValue.stack) { + res.end(errorValue.stack); + } else { + res.end(errorValue.toString()); + } } else if (typeof successValue !== 'string') { // Arbitrary object/number/etc - JSON-serialize it res.setHeader('Content-Type', 'application/json');