Sentry is NOT reporting error inside Flutter

1,740

Check in your sentry dashboard if you are using the free version and if the monthly quota hasnt been surpassed. If that is the case you will not receive any events.

Share:
1,740
user1187968
Author by

user1187968

Updated on December 20, 2022

Comments

  • user1187968
    user1187968 over 1 year

    I have my Sentry setup like this:

    void main() => runZonedGuarded(() {
      runApp(MyApp());
    }, (Object error, StackTrace stackTrace) {
      reportError(error, stackTrace);
    });
    

    and related functions

    final SentryClient sentry = new SentryClient(dsn: '<my-dsn>');
    
    
    Future<void> reportError(dynamic error, dynamic stackTrace) async {
      sentry.captureException(
        exception: error,
        stackTrace: stackTrace,
      );
    }
    

    I added throw Exception("my-error") inside a widget's build method, I can't see the error is showing on the Sentry web console.

    I create a single file to throw exception and sentry capture, and I do see sentry is reporting the error.

    Something must wrong with runZonedGuarded.