code: function retry(err) {
        if (retries < maxRetries) {
          return _Bluebird2['default'].delay(ms).then(function () {
            return loop(fn, retries + 1);
          });
        }
  
        return _Bluebird2['default'].reject(err);
      }
docs: Retries fn through the loop after the delay (ms).
  If all retries have been exhausted the err is returned
  as the reason for rejection of the promise.
  
  @param err
  
  @returns {Promise}