From 3b1e96e0747793db0cb10d2648870df56718b4ae Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Mon, 22 Jan 2024 13:08:36 -0800 Subject: [PATCH] Remove duplicate code as suggested by natebosch. (#141988) See https://github.com/flutter/flutter/pull/141821/files#r1462288131. --- packages/flutter_tools/test/src/context.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/flutter_tools/test/src/context.dart b/packages/flutter_tools/test/src/context.dart index 64ff421065..f917d28a04 100644 --- a/packages/flutter_tools/test/src/context.dart +++ b/packages/flutter_tools/test/src/context.dart @@ -148,11 +148,11 @@ void testUsingContext( 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 { + // 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) { completer.complete(); }