emergency patch

This commit is contained in:
snwy 2024-04-10 15:39:28 -04:00
parent d292d9e407
commit 312084e37d

View file

@ -10,11 +10,18 @@ export const getAllOnboardProjects = async () => {
}
}
const res = await fetch(url, fetchOptions).then(r => r.json())
let res;
try { res = await fetch(url, fetchOptions).then(r => r.json()) }
catch (e) {
console.error('Failed to fetch projects from GitHub', e)
return []
}
if (res.message && res.message.startsWith('API rate limit exceeded')) {
console.error('GitHub API rate limit exceeded')
return []
}
if(!res) return []
const projects = []