Permalink
Browse files

don't retry on ssl errors

  • Loading branch information...
1 parent 26a10ad commit 20f92a319419ecb3c9e3c949718a676e06b65cfe @isaacs isaacs committed Aug 27, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/request.js
View
8 lib/request.js
@@ -111,10 +111,16 @@ function regRequest (method, where, what, etag, nofollow, cb_) {
var self = this
operation.attempt(function (currentAttempt) {
- self.log.info("retry", "registry request attempt " + currentAttempt
+ self.log.info("trying", "registry request attempt " + currentAttempt
+ " at " + (new Date()).toLocaleTimeString())
makeRequest.call(self, method, remote, where, what, etag, nofollow, token
, function (er, parsed, raw, response) {
+ if (!er || er.message.match(/^SSL Error/)) {
+ if (er)
+ er.code = 'ESSL'
+ return cb(er, parsed, raw, response)
+ }
+
// Only retry on 408, 5xx or no `response`.
var statusCode = response && response.statusCode
var reauth = statusCode === 401

0 comments on commit 20f92a3

Please sign in to comment.