Handle 'Existing VM service clients' error from old VM service instances (#74665)

This commit is contained in:
Ben Konyi
2021-01-25 12:29:05 -08:00
committed by GitHub
parent 30cf0d4a16
commit 92427f260a
3 changed files with 51 additions and 5 deletions

View File

@@ -72,14 +72,17 @@ class DartDevelopmentService {
e.message.split(' ').firstWhere((String e) => e.startsWith('http'))
);
} on StateError {
if (e.message.contains('Existing VM service clients prevent DDS from taking control.')) {
throwToolExit('${e.message}. Please rebuild your application with a newer version of Flutter.');
return;
}
logger.printError(
'DDS has failed to start and there is not an existing DDS instance '
'available to connect to. Please comment on '
'https://github.com/flutter/flutter/issues/72385 with output from '
'"flutter doctor -v" and the following error message:\n\n ${e.message}.'
'available to connect to. Please file an issue at https://github.com/flutter/flutter/issues '
'with the following error message:\n\n ${e.message}.'
);
// Wrap the DDS error message in a StateError so it can be collected
// by the crash handler.
// DDS was unable to start for an unknown reason. Raise a StateError
// so it can be reported by the crash reporter.
throw StateError(e.message);
}
}

View File

@@ -274,6 +274,8 @@ class FlutterDevice {
} else {
existingDds = true;
}
} on ToolExit {
rethrow;
} on Exception catch (e, st) {
handleError(e, st);
return;