Unverified Commit 3b1e96e0 authored by Matan Lurey's avatar Matan Lurey Committed by GitHub

Remove duplicate code as suggested by natebosch. (#141988)

See https://github.com/flutter/flutter/pull/141821/files#r1462288131.
parent a3cd05c6
...@@ -148,11 +148,11 @@ void testUsingContext( ...@@ -148,11 +148,11 @@ void testUsingContext(
return await testMethod(); return await testMethod();
}, },
); );
// This catch rethrows, so doesn't need to catch only Exception.
} catch (error) { // ignore: avoid_catches_without_on_clauses
_printBufferedErrors(context);
rethrow;
} finally { } finally {
// We do not need a catch { ... } block because the error zone
// will catch all errors and send them to the completer below.
//
// See https://github.com/flutter/flutter/pull/141821/files#r1462288131.
if (!completer.isCompleted) { if (!completer.isCompleted) {
completer.complete(); completer.complete();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment