flutter/packages/flutter_tools/test/general.shard/base
Andrew Kolos 37d80ce25f
add filesystem error handling to systemTempDirectory (#158481)
Fixes https://github.com/flutter/flutter/issues/153777.

To summarize that issue, `ErrorHandlingFileSystem.systemTempDirectory` calls [`LocalFileSystem.systemTempDirectory`](45c8881eb2/packages/flutter_tools/lib/src/base/file_system.dart (L229)), which makes a `Directory.createSync` call, which can throw exceptions that _should_ be handled and result in a graceful tool exit (e.g. insufficient storage). However, we aren't catching those, hence this issue. 

All we need to do is wrap that call with the `FileSystemException`-handling logic we already have in the tool. See the diff.

I don't think I'll be cherry-picking this since 1) it's not an extremely common crash and 2) users can probably pick apart the crash message and figure out that they need to clear some storage space to proceed.

<details>

<summary> Pre-launch checklist </summary> 

</details>
2024-11-12 18:14:45 +00:00
..
analyze_size_test.dart [tool] Remove some usages of deprecated usage package (#151359) 2024-07-09 18:17:21 +00:00
async_guard_test.dart fixes to anticipate next Dart linter release (#127211) 2023-05-19 21:27:24 +00:00
bot_detector_test.dart [flutter_tools] fix null check in crash reporter (#80382) 2021-04-13 14:04:25 -07:00
build_test.dart [tools] Make SnapshotType.platform non-nullable (#146958) 2024-04-18 16:34:06 +00:00
command_help_test.dart Support disabling animations in the CLI (#132239) 2023-08-23 03:35:22 +00:00
common_test.dart use throwsXxx instead of throwsA(isA<Xxx>()) (#82328) 2021-05-12 09:59:02 -07:00
context_test.dart use throwsA (#82238) 2021-05-11 10:19:01 -07:00
dds_exception_test.dart Fix bad pattern matching in DDS exception parsing (#152685) 2024-08-01 14:38:22 -04:00
deferred_component_test.dart [reland] Support conditional bundling of assets based on --flavor (#139834) 2023-12-14 05:30:10 +00:00
error_handling_io_test.dart add filesystem error handling to systemTempDirectory (#158481) 2024-11-12 18:14:45 +00:00
file_system_test.dart Update copyDirectory to allow links to not be followed (#144040) 2024-02-26 16:07:22 +00:00
fingerprint_test.dart Only run pod install on the first iOS build (#108205) 2022-07-26 19:39:06 +00:00
io_test.dart Enable avoid_redundant_argument_values lint (#91409) (#91462) 2021-10-08 09:25:14 -07:00
logger_test.dart Reduce animations further when --no-cli-animations is set. (#133598) 2023-11-16 21:05:22 +00:00
multi_root_file_system_test.dart Add MultiRootFileSystem to better support using --filesystem-root. (#82991) 2021-05-24 22:04:02 -07:00
net_test.dart Enable avoid_redundant_argument_values lint (#91409) (#91462) 2021-10-08 09:25:14 -07:00
os_test.dart Reland #128236 "Improve build output for all platforms" (#145495) 2024-03-23 12:05:21 +00:00
os_utils_test.dart Flutter preview device (#135639) 2023-10-18 00:27:54 +00:00
platform_test.dart Convert some general.shard base tests to null safety (#79985) 2021-04-08 14:55:19 -07:00
process_test.dart [tool] when writing to openssl as a part of macOS/iOS code-signing, flush the stdin stream before closing it (#150120) 2024-06-28 22:01:04 +00:00
signals_test.dart [flutter_tools] Run ShutdownHooks when handling signals (#134590) 2023-09-13 13:05:29 -07:00
task_queue_test.dart [flutter_tools] Replace Future.catchError() with Future.then(onError: ...) (#120637) 2023-02-15 19:03:00 +00:00
terminal_test.dart Remove one set of parens that wrap a single String literal (#152031) 2024-08-01 19:13:13 +00:00
user_messages_test.dart Switch to more reliable flutter.dev link destinations in the tool (#150587) 2024-06-26 23:30:39 +00:00