Skip to content

Rework Error Handling with Catcher

Marwin Lebensky requested to merge mlbn33/tc-frontend:catcherConfig into master

This MR features the following changes:

  • Add the possibility to dynamically manage Reporting Types
  • Uses SharedPreferences to store the changes
  • Now has a CustomPreferenceReportMode
  • Defaults to "true" in debug-mode for both reporting and dialog
  • Can be changed in the standard settings menu
  • In Release mode, you can get "some" debug-options if you tap 10 Times on "Fehlerbericht"/"Error reporting"
  • Dialogs now have more informations about the error and are styled like any other dialog (uses TCDialog Widget)
  • The option for SilentReportMode is DEFAULTED in release! This was the main issue of this MR

Tested on (DEBUG and RELEASE)

  • Samsung Galaxy S8
  • Samsung Galaxy S10
  • iPhone XR

Catcher throws too many popups for example in cafeteria, when ~15 SocketExceptions are thrown because of the CachedNetworkImage Loading

DialogReportMode is too aggressive for the end user

  "debug": CatcherOptions(SilentReportMode(), [
    _defaultConsoleHandler,
    if (_debugDsn != null) _debugSentryHandler,
  ]),
  "profile": CatcherOptions(SilentReportMode(), [
    _defaultConsoleHandler,
    if (_debugDsn != null) _debugSentryHandler,
  ]),
  "release": CatcherOptions(DialogReportMode(), [
    if (_releaseDsn != null)
      SentryHandler(
        SentryClient(
          dsn: _releaseDsn,
        ),
        printLogs: false,
      ),
  ]),

Differences:

SilentReportMode

  • throws no dialogs

DialogReportMode

  • throws dialogs (e.g. when SocketExceptions occur in cafeteria, loading images)
  • @rapl42 -> Dialog gives the user the option to not send reports

Sentry Handler

 SentryHandler(
        SentryClient(
          dsn: _releaseDsn,
        ),
        printLogs: false,
      ),

What information does the SentryHandler get? I think we can ask the user before logging in to silently report everything. if the user declines, just send nothing. Thoughts on that?

Edited by Marwin Lebensky

Merge request reports