Improve static generation error logging
This commit is contained in:
parent
29b64ff376
commit
5a97b8f7c2
@ -25,7 +25,11 @@ export const staticallyGeneratePhotosIfConfigured = (type: StaticOutput) =>
|
|||||||
? async () => {
|
? async () => {
|
||||||
const photos = await getPublicPhotoIds({
|
const photos = await getPublicPhotoIds({
|
||||||
limit: GENERATE_STATIC_PARAMS_LIMIT,
|
limit: GENERATE_STATIC_PARAMS_LIMIT,
|
||||||
});
|
})
|
||||||
|
.catch(e => {
|
||||||
|
console.error(`Error fetching static photo data: ${e}`);
|
||||||
|
return [];
|
||||||
|
});
|
||||||
if (IS_BUILDING) {
|
if (IS_BUILDING) {
|
||||||
logStaticGenerationDetails(photos.length, `photo ${type}`);
|
logStaticGenerationDetails(photos.length, `photo ${type}`);
|
||||||
}
|
}
|
||||||
@ -45,7 +49,12 @@ export const staticallyGenerateCategoryIfConfigured = <T, K>(
|
|||||||
(type === 'image' && STATICALLY_OPTIMIZED_PHOTO_CATEGORY_OG_IMAGES)
|
(type === 'image' && STATICALLY_OPTIMIZED_PHOTO_CATEGORY_OG_IMAGES)
|
||||||
)
|
)
|
||||||
? async () => {
|
? async () => {
|
||||||
const data = (await getData()).slice(0, GENERATE_STATIC_PARAMS_LIMIT);
|
const data = (await getData()
|
||||||
|
.catch(e => {
|
||||||
|
console.error(`Error fetching static ${key} data: ${e}`);
|
||||||
|
return [];
|
||||||
|
}))
|
||||||
|
.slice(0, GENERATE_STATIC_PARAMS_LIMIT);
|
||||||
if (IS_BUILDING) {
|
if (IS_BUILDING) {
|
||||||
logStaticGenerationDetails(
|
logStaticGenerationDetails(
|
||||||
data.length,
|
data.length,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user