Intro to Error Monitoring

In this module, you’ll learn how to add error monitoring to your apps using Sentry.

But why do you need error monitoring in the first place?

If your app throws an exception during development, the debugger will scream at you:

An uncaught exception during development in VSCode

In this scenario:

  • You know the exact file and line where the exception was thrown.
  • You have a full stack trace.
  • You can inspect all local and global variables.
  • You understand the sequence of events leading up to the exception.

This makes it relatively easy to fix your issue, using your IDE and the available debugging tools.

Monitoring Errors in Production

But what happens when the app crashes for your users in production?

Without proper monitoring, you’re essentially “flying blind” and you don’t have any answers to these questions:

  • What issues are most frequent?
  • What is their impact?
  • On which devices and OS versions do they occur?
  • Which app versions are affected?
  • What actions did the user take before the app crashed?

Tools like Sentry and Crashlytics can capture all this information (if configured correctly), making your job much easier.

In the upcoming lessons, you’ll learn how to monitor your apps in production, fix bugs, and ultimately, make your users happy.

When should you add error monitoring?

If you’re planning to ship a Flutter app in production, I highly recommend adding error monitoring before your first release and tracking production issues from day one. If your app is already live, do yourself a favor and add error monitoring in your next release. ✅

Also, consider that during the app review process, your app will be tested on various devices and may be rejected if it crashes. In this scenario, error monitoring can provide invaluable information about what went wrong and how to fix it.

What we will cover

Error monitoring is a broad topic, and in this module, we’ll cover the essentials:

  • A comparison of Sentry and Crashlytics
  • Sentry installation and setup (including environments and flavors)
  • Example of fixing an issue reported by Sentry
  • Overview of the Sentry dashboard and issue resolution workflow
  • Collecting and reporting in-app user feedback
  • Additional Sentry options and APIs (including navigation and HTTP breadcrumbs)
  • How to catch and report errors in Flutter (Flutter.onError and PlatformDispatcher)
  • The difference between debug and release builds and the importance of source maps and dSYM files

By the end, you’ll know how to track and manage issues effectively as they appear in production, ensuring your app works reliably for your users.

A handy checklist is also included, so you can quickly add Sentry to your Flutter apps.

Let’s get started! 🚀

Questions? Let's chat

⚠️