superagent 3.7.0 → 3.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,25 +0,0 @@
1
- 'use strict';
2
-
3
- var ERROR_CODES = [
4
- 'ECONNRESET',
5
- 'ETIMEDOUT',
6
- 'EADDRINFO',
7
- 'ESOCKETTIMEDOUT'
8
- ];
9
-
10
- /**
11
- * Determine if a request should be retried.
12
- * (Borrowed from segmentio/superagent-retry)
13
- *
14
- * @param {Error} err
15
- * @param {Response} [res]
16
- * @returns {Boolean}
17
- */
18
- module.exports = function shouldRetry(err, res) {
19
- if (err && err.code && ~ERROR_CODES.indexOf(err.code)) return true;
20
- if (res && res.status && res.status >= 500) return true;
21
- // Superagent timeout
22
- if (err && 'timeout' in err && err.code == 'ECONNABORTED') return true;
23
- if (err && 'crossDomain' in err) return true;
24
- return false;
25
- };