Return null instead of empty in Future.catchError callbacks (#72409)
This commit is contained in:
@@ -618,7 +618,7 @@ class BrowserManager {
|
||||
throwToolExit('${runtime.name} exited with code $browserExitCode before connecting.');
|
||||
}).catchError((dynamic error, StackTrace stackTrace) {
|
||||
if (completer.isCompleted) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
completer.completeError(error, stackTrace);
|
||||
}));
|
||||
@@ -630,7 +630,7 @@ class BrowserManager {
|
||||
}).catchError((dynamic error, StackTrace stackTrace) {
|
||||
chrome.close();
|
||||
if (completer.isCompleted) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
completer.completeError(error, stackTrace);
|
||||
}));
|
||||
|
||||
@@ -179,7 +179,10 @@ abstract class FlutterTestDriver {
|
||||
// it forcefully and it won't terminate child processes, so we need to ensure
|
||||
// it's running before terminating.
|
||||
await resume().timeout(defaultTimeout)
|
||||
.catchError((Object e) => _debugPrint('Ignoring failure to resume during shutdown'));
|
||||
.catchError((Object e) {
|
||||
_debugPrint('Ignoring failure to resume during shutdown');
|
||||
return null;
|
||||
});
|
||||
|
||||
_debugPrint('Sending SIGTERM to $_processPid..');
|
||||
io.Process.killPid(_processPid, io.ProcessSignal.sigterm);
|
||||
|
||||
Reference in New Issue
Block a user