mirror of
https://github.com/hanzoai/react.git
synced 2026-09-24 17:02:27 +00:00
Handle github rate limiting response (#24573)
Make the error messages clearer when the API doesn't respond with 200.
This commit is contained in:
@@ -23,7 +23,14 @@ async function getBuildIdForCommit(sha) {
|
||||
);
|
||||
|
||||
if (!statusesResponse.ok) {
|
||||
throw Error('Could not find commit for: ' + sha);
|
||||
if (statusesResponse.status === 404) {
|
||||
throw Error('Could not find commit for: ' + sha);
|
||||
}
|
||||
const {message, documentation_url} = await statusesResponse.json();
|
||||
const msg = documentation_url
|
||||
? `${message}\n\t${documentation_url}`
|
||||
: message;
|
||||
throw Error(msg);
|
||||
}
|
||||
|
||||
const {statuses, state} = await statusesResponse.json();
|
||||
|
||||
Reference in New Issue
Block a user