fix: error handling
This commit is contained in:
parent
b324dc6b29
commit
5ee77b32f0
3 changed files with 10 additions and 4 deletions
|
@ -62,7 +62,13 @@ export const onPreBuild = async ({ constants }) => {
|
|||
}
|
||||
|
||||
for (const key of yearKeys) {
|
||||
const scrobbleData = await scrobbles.get(key, { type: 'json'})
|
||||
let scrobbleData;
|
||||
try {
|
||||
scrobbleData = await scrobbles?.get(key, { type: 'json'})
|
||||
} catch (error) {
|
||||
console.log("Error: can't get more scrobbles.")
|
||||
break;
|
||||
}
|
||||
yearChartData['data'].push(...scrobbleData['data'])
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue