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
e25cd84a
Unverified
Commit
e25cd84a
authored
Oct 28, 2019
by
Jonah Williams
Committed by
GitHub
Oct 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Catch failed startup error from build_daemon (#43598)
parent
7de800c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
resident_web_runner.dart
...utter_tools/lib/src/build_runner/resident_web_runner.dart
+9
-0
resident_web_runner_test.dart
...er_tools/test/general.shard/resident_web_runner_test.dart
+20
-0
No files found.
packages/flutter_tools/lib/src/build_runner/resident_web_runner.dart
View file @
e25cd84a
...
...
@@ -255,6 +255,15 @@ class ResidentWebRunner extends ResidentRunner {
'start or was killed by another process.'
);
}
on
SocketException
catch
(
err
)
{
throwToolExit
(
err
.
toString
());
}
on
StateError
catch
(
err
)
{
final
String
message
=
err
.
toString
();
if
(
message
.
contains
(
'Unable to start build daemon'
))
{
throwToolExit
(
'Failed to start build daemon. The process might have '
'exited unexpectedly during startup. Try running the application '
'again.'
);
}
rethrow
;
}
finally
{
if
(
statusActive
)
{
buildStatus
.
stop
();
...
...
packages/flutter_tools/test/general.shard/resident_web_runner_test.dart
View file @
e25cd84a
...
...
@@ -658,6 +658,26 @@ void main() {
await
expectation
;
}));
test
(
'Successfully turns failed startup StateError error into ToolExit'
,
()
=>
testbed
.
run
(()
async
{
_setupMocks
();
final
Completer
<
DebugConnectionInfo
>
connectionInfoCompleter
=
Completer
<
DebugConnectionInfo
>();
final
Completer
<
void
>
unhandledErrorCompleter
=
Completer
<
void
>();
when
(
mockWebFs
.
connect
(
any
)).
thenAnswer
((
Invocation
_
)
async
{
unawaited
(
unhandledErrorCompleter
.
future
.
then
((
void
value
)
{
throw
StateError
(
'Unable to start build daemon'
);
}));
return
ConnectionResult
(
mockAppConnection
,
mockDebugConnection
);
});
final
Future
<
void
>
expectation
=
expectLater
(()
=>
residentWebRunner
.
run
(
connectionInfoCompleter:
connectionInfoCompleter
,
),
throwsA
(
isInstanceOf
<
ToolExit
>()));
unhandledErrorCompleter
.
complete
();
await
expectation
;
}));
test
(
'Rethrows Exception type'
,
()
=>
testbed
.
run
(()
async
{
_setupMocks
();
final
Completer
<
DebugConnectionInfo
>
connectionInfoCompleter
=
Completer
<
DebugConnectionInfo
>();
...
...
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