eng: hint if rate limit error is reached on preinstall (#200993)
* eng: hint if rate limit error is reached on preinstall Fixes #194790 * compilepull/200919/head
parent
a7cdc1e2a9
commit
64c8c3fe98
|
@ -73,7 +73,11 @@ async function fetchUrl(url, options, retries = 10, retryDelay = 1000) {
|
|||
contents
|
||||
});
|
||||
}
|
||||
throw new Error(`Request ${ansiColors.magenta(url)} failed with status code: ${response.status}`);
|
||||
let err = `Request ${ansiColors.magenta(url)} failed with status code: ${response.status}`;
|
||||
if (response.status === 403) {
|
||||
err += ' (you may be rate limited)';
|
||||
}
|
||||
throw new Error(err);
|
||||
}
|
||||
finally {
|
||||
clearTimeout(timeout);
|
||||
|
|
|
@ -81,7 +81,11 @@ export async function fetchUrl(url: string, options: IFetchOptions, retries = 10
|
|||
contents
|
||||
});
|
||||
}
|
||||
throw new Error(`Request ${ansiColors.magenta(url)} failed with status code: ${response.status}`);
|
||||
let err = `Request ${ansiColors.magenta(url)} failed with status code: ${response.status}`;
|
||||
if (response.status === 403) {
|
||||
err += ' (you may be rate limited)';
|
||||
}
|
||||
throw new Error(err);
|
||||
} finally {
|
||||
clearTimeout(timeout);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue