From fa4d5fedc859bb2ab511ead70a3ab456e6681791 Mon Sep 17 00:00:00 2001 From: Eran Hammer Date: Mon, 22 Oct 2012 14:57:34 -0700 Subject: [PATCH] Allow non 4xx 5xx codes in pass-through errors --- lib/error.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/error.js b/lib/error.js index f67bdea84..9fdf302eb 100755 --- a/lib/error.js +++ b/lib/error.js @@ -120,7 +120,14 @@ internals.Error.passThrough = function (code, payload, contentType) { return response; }; - var err = new internals.Error(code, 'Pass-through', { toResponse: format }); + var err = new internals.Error(500, 'Pass-through', { toResponse: format }); // 500 code is only used internally and is not exposed when sent + + err.passThrough = { + code: code, + payload: payload, + contentType: contentType + }; + return err; };