Skip to content

Commit 90a4323

Browse files
authored
Make developing flutter_tools nicer: Use fail instead of throw StateError. (flutter#163094)
Closes flutter#163091.
1 parent e8f34a9 commit 90a4323

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/flutter_tools/test/src/context.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ void testUsingContext(
6666
skip, // should default to `false`, but https://github.com/dart-lang/test/issues/545 doesn't allow this
6767
}) {
6868
if (overrides[FileSystem] != null && overrides[ProcessManager] == null) {
69-
throw StateError(
69+
fail(
7070
'If you override the FileSystem context you must also provide a ProcessManager, '
7171
'otherwise the processes you launch will not be dealing with the same file system '
7272
'that you are dealing with in your test.',
7373
);
7474
}
7575
if (overrides.containsKey(ProcessUtils)) {
76-
throw StateError('Do not inject ProcessUtils for testing, use ProcessManager instead.');
76+
fail('Do not inject ProcessUtils for testing, use ProcessManager instead.');
7777
}
7878

7979
// Ensure we don't rely on the default [Config] constructor which will

0 commit comments

Comments
 (0)