Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
1edaec6c
Unverified
Commit
1edaec6c
authored
May 01, 2021
by
Michael Goderbauer
Committed by
GitHub
May 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add additional logging when devtools cannot launch (#81554)
parent
7912cbea
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
1 deletion
+52
-1
devtools_launcher.dart
packages/flutter_tools/lib/src/devtools_launcher.dart
+8
-1
devtools_launcher_test.dart
...tter_tools/test/general.shard/devtools_launcher_test.dart
+44
-0
No files found.
packages/flutter_tools/lib/src/devtools_launcher.dart
View file @
1edaec6c
...
...
@@ -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
)
{
...
...
packages/flutter_tools/test/general.shard/devtools_launcher_test.dart
View file @
1edaec6c
...
...
@@ -363,4 +363,48 @@ void main() {
expect
(
logger
.
errorText
,
contains
(
'Failed to launch DevTools: ProcessException'
));
});
testWithoutContext
(
'DevtoolsLauncher prints trace if connecting to pub.dev throws'
,
()
async
{
final
DevtoolsLauncher
launcher
=
DevtoolsServerLauncher
(
pubExecutable:
'pub'
,
logger:
logger
,
platform:
platform
,
persistentToolState:
persistentToolState
,
httpClient:
FakeHttpClient
.
list
(<
FakeRequest
>[
FakeRequest
(
Uri
.
https
(
'pub.dev'
,
''
),
method:
HttpMethod
.
head
,
responseError:
Exception
(
'Connection failed.'
),
),
]),
processManager:
FakeProcessManager
.
empty
(),
);
await
launcher
.
launch
(
Uri
.
parse
(
'http://127.0.0.1:1234/abcdefg'
));
expect
(
logger
.
traceText
,
contains
(
'Skipping devtools launch because connecting to pub.dev failed with Exception: Connection failed.'
));
});
testWithoutContext
(
'DevtoolsLauncher prints trace if connecting to pub.dev returns non-OK status code'
,
()
async
{
final
DevtoolsLauncher
launcher
=
DevtoolsServerLauncher
(
pubExecutable:
'pub'
,
logger:
logger
,
platform:
platform
,
persistentToolState:
persistentToolState
,
httpClient:
FakeHttpClient
.
list
(<
FakeRequest
>[
FakeRequest
(
Uri
.
https
(
'pub.dev'
,
''
),
method:
HttpMethod
.
head
,
response:
const
FakeResponse
(
statusCode:
HttpStatus
.
forbidden
),
),
]),
processManager:
FakeProcessManager
.
empty
(),
);
await
launcher
.
launch
(
Uri
.
parse
(
'http://127.0.0.1:1234/abcdefg'
));
expect
(
logger
.
traceText
,
contains
(
'Skipping devtools launch because pub.dev responded with HTTP status code 403 instead of 200.'
));
});
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment