added a new RequestTypeError class that connectionClasses can throw to prevent a request from being retried and respond directly to the user.

This commit is contained in:
Spencer Alger
2014-05-08 17:12:20 -07:00
parent 73203256d2
commit 1a383aced5
2 changed files with 14 additions and 0 deletions

View File

@ -180,6 +180,12 @@ Transport.prototype.request = function (params, cb) {
requestAborter = void 0;
if (err instanceof errors.RequestTypeError) {
self.log.error('Connection refused to execute the request', err);
respond(err, body, status, headers);
return;
}
if (err) {
connection.setStatus('dead');
if (remainingRetries) {