Handle 'Existing VM service clients' error from old VM service instances (#74665)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,6 +274,8 @@ class FlutterDevice {
|
||||
} else {
|
||||
existingDds = true;
|
||||
}
|
||||
} on ToolExit {
|
||||
rethrow;
|
||||
} on Exception catch (e, st) {
|
||||
handleError(e, st);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user