Advertisement
Intermediate Flutter, Error Handling & Crash Reporting (Sentry & Crashlytics)

Why is it valuable to log non fatal, caught errors to a crash reporting service, in addition to only tracking genuine fatal crashes that actually cause the app to fully close?

Short answer

A caught, non fatal error, meaning an error your app successfully handled gracefully without actually crashing, such as a failed network request that the user might have already retried themselves, can still genuinely indicate a real underlying problem worth investigating and…

Save Flutter mock interview
Advertisement
AModel answer
A caught, non fatal error, meaning an error your app successfully handled gracefully without actually crashing, such as a failed network request that the user might have already retried themselves, can still genuinely indicate a real underlying problem worth investigating and fixing, and logging these kinds of non fatal errors to a crash reporting service, in addition to genuine fatal crashes, gives your team a much more complete overall picture of the various issues real users are actually experiencing, including problems that might never actually cause the app to fully crash but could still be meaningfully degrading the overall user experience in a real, measurable way.
try {
  await syncUserData();
} catch (error, stackTrace) {
  FirebaseCrashlytics.instance.recordError(error, stackTrace, fatal: false);
  showRetryOption();
}
Real-world example
A team notices through their non fatal error logs that a specific background data sync operation is silently failing for a surprisingly large percentage of their actual users, despite that failure never actually causing a genuine full app crash, prompting them to investigate and properly fix the underlying root cause.
Likely follow-ups
  • How do you properly distinguish between fatal and non fatal errors when reviewing a crash reporting dashboard?
  • What is the risk of logging too many non fatal errors and how might that make genuinely serious issues harder to actually notice?
Related topics