Skip to content

Commit 64c8c3f

Browse files
authored
eng: hint if rate limit error is reached on preinstall (microsoft#200993)
* eng: hint if rate limit error is reached on preinstall Fixes microsoft#194790 * compile
1 parent a7cdc1e commit 64c8c3f

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

build/lib/fetch.js

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/lib/fetch.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ export async function fetchUrl(url: string, options: IFetchOptions, retries = 10
8181
contents
8282
});
8383
}
84-
throw new Error(`Request ${ansiColors.magenta(url)} failed with status code: ${response.status}`);
84+
let err = `Request ${ansiColors.magenta(url)} failed with status code: ${response.status}`;
85+
if (response.status === 403) {
86+
err += ' (you may be rate limited)';
87+
}
88+
throw new Error(err);
8589
} finally {
8690
clearTimeout(timeout);
8791
}

0 commit comments

Comments
 (0)