From 80cee59878f3ab54aa4670e838a901f83ce120ea Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Tue, 28 Mar 2023 08:08:57 -0700 Subject: [PATCH] Don't rethrow Dart plugin registration exceptions (#122111) Don't rethrow Dart plugin registration exceptions --- packages/flutter_tools/lib/src/flutter_plugins.dart | 1 - .../build_system/targets/dart_plugin_registrant_test.dart | 2 -- .../flutter_tools/test/general.shard/dart_plugin_test.dart | 6 ------ 3 files changed, 9 deletions(-) diff --git a/packages/flutter_tools/lib/src/flutter_plugins.dart b/packages/flutter_tools/lib/src/flutter_plugins.dart index 524ca75773..dcb9a7694c 100644 --- a/packages/flutter_tools/lib/src/flutter_plugins.dart +++ b/packages/flutter_tools/lib/src/flutter_plugins.dart @@ -703,7 +703,6 @@ const String _dartPluginRegisterWith = r''' '`{{pluginName}}` threw an error: $err. ' 'The app may not function as expected until you remove this plugin from pubspec.yaml' ); - rethrow; } '''; diff --git a/packages/flutter_tools/test/general.shard/build_system/targets/dart_plugin_registrant_test.dart b/packages/flutter_tools/test/general.shard/build_system/targets/dart_plugin_registrant_test.dart index aed5fcb4e4..7c78b96eb8 100644 --- a/packages/flutter_tools/test/general.shard/build_system/targets/dart_plugin_registrant_test.dart +++ b/packages/flutter_tools/test/general.shard/build_system/targets/dart_plugin_registrant_test.dart @@ -257,7 +257,6 @@ void main() { " '`path_provider_linux` threw an error: \$err. '\n" " 'The app may not function as expected until you remove this plugin from pubspec.yaml'\n" ' );\n' - ' rethrow;\n' ' }\n' '\n' ' } else if (Platform.isMacOS) {\n' @@ -385,7 +384,6 @@ void main() { " '`path_provider_linux` threw an error: \$err. '\n" " 'The app may not function as expected until you remove this plugin from pubspec.yaml'\n" ' );\n' - ' rethrow;\n' ' }\n' '\n' ' } else if (Platform.isMacOS) {\n' diff --git a/packages/flutter_tools/test/general.shard/dart_plugin_test.dart b/packages/flutter_tools/test/general.shard/dart_plugin_test.dart index 6c5633ff19..0ea8182e11 100644 --- a/packages/flutter_tools/test/general.shard/dart_plugin_test.dart +++ b/packages/flutter_tools/test/general.shard/dart_plugin_test.dart @@ -807,7 +807,6 @@ void main() { " '`url_launcher_android` threw an error: \$err. '\n" " 'The app may not function as expected until you remove this plugin from pubspec.yaml'\n" ' );\n' - ' rethrow;\n' ' }\n' '\n' ' } else if (Platform.isIOS) {\n' @@ -818,7 +817,6 @@ void main() { " '`url_launcher_ios` threw an error: \$err. '\n" " 'The app may not function as expected until you remove this plugin from pubspec.yaml'\n" ' );\n' - ' rethrow;\n' ' }\n' '\n' ' } else if (Platform.isLinux) {\n' @@ -829,7 +827,6 @@ void main() { " '`url_launcher_linux` threw an error: \$err. '\n" " 'The app may not function as expected until you remove this plugin from pubspec.yaml'\n" ' );\n' - ' rethrow;\n' ' }\n' '\n' ' } else if (Platform.isMacOS) {\n' @@ -840,7 +837,6 @@ void main() { " '`awesome_macos` threw an error: \$err. '\n" " 'The app may not function as expected until you remove this plugin from pubspec.yaml'\n" ' );\n' - ' rethrow;\n' ' }\n' '\n' ' try {\n' @@ -850,7 +846,6 @@ void main() { " '`url_launcher_macos` threw an error: \$err. '\n" " 'The app may not function as expected until you remove this plugin from pubspec.yaml'\n" ' );\n' - ' rethrow;\n' ' }\n' '\n' ' } else if (Platform.isWindows) {\n' @@ -861,7 +856,6 @@ void main() { " '`url_launcher_windows` threw an error: \$err. '\n" " 'The app may not function as expected until you remove this plugin from pubspec.yaml'\n" ' );\n' - ' rethrow;\n' ' }\n' '\n' ' }\n'