From 7a8f9a779fb026b70e90319f828c90a7ea68dcd8 Mon Sep 17 00:00:00 2001 From: Astro Date: Thu, 11 Dec 2014 16:24:33 +0100 Subject: [PATCH] server _onHttpRequest(): don't wrap errors in errors --- server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index b5a3cdb..72c0ce8 100644 --- a/server.js +++ b/server.js @@ -153,7 +153,7 @@ Server.prototype._onHttpRequest = function (req, res) { this._onRequest(params, function (err, response) { if (err) { - self.emit('warning', new Error(err.message)) + self.emit('warning', err) response = { 'failure reason': err.message } @@ -182,7 +182,7 @@ Server.prototype._onUdpRequest = function (msg, rinfo) { // Handle this._onRequest(params, function (err, response) { if (err) { - self.emit('warning', new Error(err.message)) + self.emit('warning', err) response = { action: common.ACTIONS.ERRROR, 'failure reason': err.message