Unverified Commit 0dc80621 authored by Sam Rawlins's avatar Sam Rawlins Committed by GitHub

Return null instead of empty in Future.catchError callbacks (#72409)

parent a3971153
...@@ -618,7 +618,7 @@ class BrowserManager { ...@@ -618,7 +618,7 @@ class BrowserManager {
throwToolExit('${runtime.name} exited with code $browserExitCode before connecting.'); throwToolExit('${runtime.name} exited with code $browserExitCode before connecting.');
}).catchError((dynamic error, StackTrace stackTrace) { }).catchError((dynamic error, StackTrace stackTrace) {
if (completer.isCompleted) { if (completer.isCompleted) {
return; return null;
} }
completer.completeError(error, stackTrace); completer.completeError(error, stackTrace);
})); }));
...@@ -630,7 +630,7 @@ class BrowserManager { ...@@ -630,7 +630,7 @@ class BrowserManager {
}).catchError((dynamic error, StackTrace stackTrace) { }).catchError((dynamic error, StackTrace stackTrace) {
chrome.close(); chrome.close();
if (completer.isCompleted) { if (completer.isCompleted) {
return; return null;
} }
completer.completeError(error, stackTrace); completer.completeError(error, stackTrace);
})); }));
......
...@@ -179,7 +179,10 @@ abstract class FlutterTestDriver { ...@@ -179,7 +179,10 @@ abstract class FlutterTestDriver {
// it forcefully and it won't terminate child processes, so we need to ensure // it forcefully and it won't terminate child processes, so we need to ensure
// it's running before terminating. // it's running before terminating.
await resume().timeout(defaultTimeout) 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..'); _debugPrint('Sending SIGTERM to $_processPid..');
io.Process.killPid(_processPid, io.ProcessSignal.sigterm); io.Process.killPid(_processPid, io.ProcessSignal.sigterm);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment