Skip to content
This repository
Browse code

don't retry on ssl errors

  • Loading branch information...
commit 20f92a319419ecb3c9e3c949718a676e06b65cfe 1 parent 26a10ad
Isaac Z. Schlueter authored August 27, 2012

Showing 1 changed file with 7 additions and 1 deletion. Show diff stats Hide diff stats

  1. 8  lib/request.js
8  lib/request.js
@@ -111,10 +111,16 @@ function regRequest (method, where, what, etag, nofollow, cb_) {
111 111
 
112 112
   var self = this
113 113
   operation.attempt(function (currentAttempt) {
114  
-    self.log.info("retry", "registry request attempt " + currentAttempt
  114
+    self.log.info("trying", "registry request attempt " + currentAttempt
115 115
         + " at " + (new Date()).toLocaleTimeString())
116 116
     makeRequest.call(self, method, remote, where, what, etag, nofollow, token
117 117
                      , function (er, parsed, raw, response) {
  118
+      if (!er || er.message.match(/^SSL Error/)) {
  119
+        if (er)
  120
+          er.code = 'ESSL'
  121
+        return cb(er, parsed, raw, response)
  122
+      }
  123
+
118 124
       // Only retry on 408, 5xx or no `response`.
119 125
       var statusCode = response && response.statusCode
120 126
       var reauth = statusCode === 401

0 notes on commit 20f92a3

Please sign in to comment.
Something went wrong with that request. Please try again.