github-repository-provider 7.23.42 → 7.23.46

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "github-repository-provider",
3
- "version": "7.23.42",
3
+ "version": "7.23.46",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -36,13 +36,13 @@
36
36
  "matching-iterator": "^2.0.0",
37
37
  "node-fetch": "3.1.0",
38
38
  "one-time-execution-method": "^2.0.9",
39
- "repository-provider": "^26.0.1"
39
+ "repository-provider": "^26.0.2"
40
40
  },
41
41
  "devDependencies": {
42
42
  "ava": "^3.15.0",
43
43
  "c8": "^7.10.0",
44
44
  "documentation": "^13.2.5",
45
- "repository-provider-test-support": "^1.8.10",
45
+ "repository-provider-test-support": "^1.8.11",
46
46
  "semantic-release": "^18.0.1"
47
47
  },
48
48
  "engines": {
@@ -154,17 +154,23 @@ export class GithubBranch extends Branch {
154
154
  const url = `repos/${this.slug}/git/trees/${treeSha}?recursive=1`;
155
155
 
156
156
  let res;
157
- for (const i = 0; i < 3; i++) {
158
- res = await this.provider.fetch(url);
159
- if (res.ok) {
160
- const json = await res.json();
161
- return json.tree;
157
+ for (let i = 0; i < 3; i++) {
158
+ try {
159
+ res = await this.provider.fetch(url);
160
+ if (res.ok) {
161
+ const json = await res.json();
162
+ return json.tree;
163
+ }
164
+ } catch (e) {
165
+ // errno: 'ERR_STREAM_PREMATURE_CLOSE',
166
+ // code: 'ERR_STREAM_PREMATURE_CLOSE',
167
+
168
+ console.error(e);
169
+ this.error(e);
162
170
  }
163
171
  }
164
172
 
165
173
  console.log(res.errno, res.code);
166
- // errno: 'ERR_STREAM_PREMATURE_CLOSE',
167
- // code: 'ERR_STREAM_PREMATURE_CLOSE',
168
174
 
169
175
  throw new Error(res.status);
170
176
  }