server _onHttpRequest(): don't wrap errors in errors

This commit is contained in:
Astro 2014-12-11 16:24:33 +01:00
parent 74d9139049
commit 7a8f9a779f

View File

@ -153,7 +153,7 @@ Server.prototype._onHttpRequest = function (req, res) {
this._onRequest(params, function (err, response) { this._onRequest(params, function (err, response) {
if (err) { if (err) {
self.emit('warning', new Error(err.message)) self.emit('warning', err)
response = { response = {
'failure reason': err.message 'failure reason': err.message
} }
@ -182,7 +182,7 @@ Server.prototype._onUdpRequest = function (msg, rinfo) {
// Handle // Handle
this._onRequest(params, function (err, response) { this._onRequest(params, function (err, response) {
if (err) { if (err) {
self.emit('warning', new Error(err.message)) self.emit('warning', err)
response = { response = {
action: common.ACTIONS.ERRROR, action: common.ACTIONS.ERRROR,
'failure reason': err.message 'failure reason': err.message