reportExceptionNoticed method

  1. @override
void reportExceptionNoticed(
  1. FlutterErrorDetails exception
)
override

Called when the framework catches an exception, even if that exception is being handled by takeException.

This is called when there is no pending exception; if multiple exceptions are thrown and takeException isn't used, then subsequent exceptions are logged to the console regardless (and the test will fail).

Implementation

@override
void reportExceptionNoticed(FlutterErrorDetails exception) {
  // This method is called to log errors as they happen, and they will also
  // be eventually logged again at the end of the tests. The superclass
  // behavior is specific to the "live" execution semantics of
  // [LiveTestWidgetsFlutterBinding] so users don't have to wait until tests
  // finish to see the stack traces.
  //
  // Disable this because Integration Tests follow the semantics of
  // [AutomatedTestWidgetsFlutterBinding] that does not log the stack traces
  // live, and avoids the doubly logged stack trace.
  // TODO(jiahaog): Integration test binding should not inherit from
  // `LiveTestWidgetsFlutterBinding` https://github.com/flutter/flutter/issues/81534
}