diff --git a/packages/flutter_tools/lib/src/commands/custom_devices.dart b/packages/flutter_tools/lib/src/commands/custom_devices.dart index a42123a150..1d7cb0db66 100644 --- a/packages/flutter_tools/lib/src/commands/custom_devices.dart +++ b/packages/flutter_tools/lib/src/commands/custom_devices.dart @@ -780,7 +780,7 @@ class CustomDevicesAddCommand extends CustomDevicesCommandBase { pingSuccessRegex: null ); } else { - throw FallThroughError(); + throw UnsupportedError('Unsupported operating system'); } final bool apply = await askApplyConfig( @@ -809,7 +809,7 @@ class CustomDevicesAddCommand extends CustomDevicesCommandBase { if (boolArgDeprecated(_kSsh) == true) { return runInteractivelySsh(); } - throw FallThroughError(); + throw UnsupportedError('Unknown run mode'); } } diff --git a/packages/flutter_tools/lib/src/custom_devices/custom_device_config.dart b/packages/flutter_tools/lib/src/custom_devices/custom_device_config.dart index 7f5c031141..c5375f4b31 100644 --- a/packages/flutter_tools/lib/src/custom_devices/custom_device_config.dart +++ b/packages/flutter_tools/lib/src/custom_devices/custom_device_config.dart @@ -138,7 +138,7 @@ class CustomDeviceConfig { platform = archString == null ? null : getTargetPlatformForName(archString); - } on FallThroughError { + } on UnsupportedError { throw const CustomDeviceRevivalException.fromDescriptions( _kPlatform, 'null or one of linux-arm64, linux-x64' @@ -300,7 +300,7 @@ class CustomDeviceConfig { if (platform.isLinux || platform.isMacOS) { return exampleUnix; } - throw FallThroughError(); + throw UnsupportedError('Unsupported operating system'); } final String id; diff --git a/packages/flutter_tools/test/commands.shard/hermetic/custom_devices_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/custom_devices_test.dart index 29d93c9832..3a3f057c01 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/custom_devices_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/custom_devices_test.dart @@ -323,7 +323,7 @@ CustomDevicesCommand createCustomDevicesCommand({ hostPlatform: platform.isLinux ? HostPlatform.linux_x64 : platform.isWindows ? HostPlatform.windows_x64 : platform.isMacOS ? HostPlatform.darwin_x64 - : throw FallThroughError() + : throw UnsupportedError('Unsupported operating system') ), terminal: terminal != null ? terminal(platform)