1.2.0: report non-fatal errors to Crashlytics across key error paths

CrashlyticsService was wired only for the is_premium custom key. Route the
swallowed errors in the main catch blocks through CrashlyticsService.record
with a context tag, so non-fatals show up in Firebase (StoreKit load/purchase/
restore, calendar access/create/update/delete, reset-all-data, onboarding save).
Debug prints kept.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BkanrydYtrme8wipTzWssG
This commit is contained in:
alexandrev-tibco
2026-07-10 14:27:28 +02:00
parent 619d5f921d
commit 56abe28a82
4 changed files with 10 additions and 0 deletions
@@ -172,6 +172,7 @@ final class OnboardingViewModel: ObservableObject {
UserDefaults.standard.set(true, forKey: Self.pendingPremiumPromptKey)
return true
} catch {
CrashlyticsService.record(error, context: "onboarding_save")
print("Onboarding save failed: \(error)")
return false
}
@@ -97,12 +97,14 @@ final class SettingsViewModel: ObservableObject {
UserDefaults.standard.set(false, forKey: OnboardingViewModel.pendingPremiumPromptKey)
try context.save()
} catch {
CrashlyticsService.record(error, context: "reset_all_data")
#if DEBUG
print("Failed to complete reset all data: \(error)")
#endif
}
}
} catch {
CrashlyticsService.record(error, context: "reset_all_data_start")
#if DEBUG
print("Failed to start reset all data: \(error)")
#endif