Skip to content

Commit

Permalink
Allow non 4xx 5xx codes in pass-through errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Eran Hammer committed Oct 22, 2012
1 parent eb8bd85 commit fa4d5fe
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down

0 comments on commit fa4d5fe

Please sign in to comment.