mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
fix: handle http code 403
GitHub API doesn't return CORS headers when not ok
This commit is contained in:
parent
b9d4bfd07d
commit
012aa94a87
1 changed files with 1 additions and 0 deletions
|
|
@ -39,6 +39,7 @@ async function request(
|
|||
throw new Error(`Response content type is "${contentType}"`)
|
||||
} else {
|
||||
if (res.status === 404 || res.status === 401) throw new Error(errors.NOT_FOUND)
|
||||
else if (res.status === 403) throw new Error(errors.API_RATE_LIMIT)
|
||||
else if (res.status === 500) throw new Error(errors.SERVER_FAULT)
|
||||
else if (isJson) {
|
||||
const content = await res.json()
|
||||
|
|
|
|||
Loading…
Reference in a new issue