Add additional logging when devtools cannot launch (#81554)

This commit is contained in:
Michael Goderbauer
2021-04-30 17:54:02 -07:00
committed by GitHub
parent 7912cbea38
commit 1edaec6c2c
2 changed files with 52 additions and 1 deletions

View File

@@ -67,9 +67,16 @@ class DevtoolsServerLauncher extends DevtoolsLauncher {
final io.HttpClientResponse response = await request.close();
await response.drain<void>();
if (response.statusCode != io.HttpStatus.ok) {
_logger.printTrace(
'Skipping devtools launch because pub.dev responded with HTTP '
'status code ${response.statusCode} instead of ${io.HttpStatus.ok}.',
);
offline = true;
}
} on Exception {
} on Exception catch (e) {
_logger.printTrace(
'Skipping devtools launch because connecting to pub.dev failed with $e',
);
offline = true;
} on ArgumentError {
if (!useOverrideUrl) {