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');