fix: reset token status on update and suppress metric errors

This commit is contained in:
Michael committed 2026-01-21 16:14:08 +01:00
1 parent 566782fa82
commit c37a56b366
2 files changed
+14 -3

No files matched your search

+7 -2
View File
@@ -211,8 +211,13 @@ export class AnalyticsService {
};
pageReach = findMetric('page_impressions');
} catch (error) {
console.warn(`[AnalyticsService] Failed to fetch insights for ${pageId} (Permissions?):`, error);
} catch (error: any) {
// Code 100: Invalid Parameter (often means metric not available for this page type)
if (error.code === 100) {
console.warn(`[AnalyticsService] Metrics unavailable for ${pageId} (Code 100). This is likely due to page type restrictions. Skipping insights.`);
} else {
console.warn(`[AnalyticsService] Failed to fetch insights for ${pageId}:`, error.message);
}
// Continue execution to save at least the follower count
}