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
3871b0eb
Commit
3871b0eb
authored
Jul 22, 2016
by
John McCutchan
Committed by
GitHub
Jul 22, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4998 from johnmccutchan/hot_catch_reload_failures
Fix hot reload failure handling
parents
7beedd7a
f6de2fbf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
16 deletions
+13
-16
flx.dart
packages/flutter_tools/lib/src/flx.dart
+1
-1
observatory.dart
packages/flutter_tools/lib/src/observatory.dart
+6
-10
run.dart
packages/flutter_tools/lib/src/run.dart
+6
-5
No files found.
packages/flutter_tools/lib/src/flx.dart
View file @
3871b0eb
...
...
@@ -211,7 +211,7 @@ ZipEntry _obtainLicenses(
// splitting each one into each component license (so that we can
// de-dupe if possible).
final
Set
<
String
>
packageLicenses
=
new
Set
<
String
>();
final
List
<
Uri
>
packages
=
packageMap
.
map
.
values
;
final
Iterable
<
Uri
>
packages
=
packageMap
.
map
.
values
;
for
(
Uri
package
in
packages
)
{
if
(
package
!=
null
&&
package
.
scheme
==
'file'
)
{
final
File
file
=
new
File
.
fromUri
(
package
.
resolve
(
'../LICENSE'
));
...
...
packages/flutter_tools/lib/src/observatory.dart
View file @
3871b0eb
...
...
@@ -114,17 +114,13 @@ class Observatory {
});
}
Future
<
Response
>
reloadSources
(
String
isolateId
)
async
{
Completer
<
Event
>
whenIsolateReloads
=
new
Completer
<
Event
>();
StreamSubscription
<
Event
>
sub
=
onIsolateEvent
.
where
((
Event
event
)
=>
event
.
kind
==
'IsolateReload'
)
.
listen
((
Event
event
)
=>
whenIsolateReloads
.
complete
(
event
));
Future
<
Null
>
reloadSources
(
String
isolateId
)
async
{
try
{
await
sendRequest
(
'_reloadSources'
,
<
String
,
dynamic
>{
'isolateId'
:
isolateId
});
return
await
whenIsolateReloads
.
future
.
timeout
(
new
Duration
(
seconds:
20
));
}
finally
{
await
sub
.
cancel
();
await
sendRequest
(
'_reloadSources'
,
<
String
,
dynamic
>{
'isolateId'
:
isolateId
});
return
null
;
}
catch
(
e
)
{
return
new
Future
<
Null
>.
error
(
e
.
data
[
'details'
]);
}
}
...
...
packages/flutter_tools/lib/src/run.dart
View file @
3871b0eb
...
...
@@ -378,13 +378,14 @@ class RunAndStayResident {
await
_updateDevFS
();
}
Status
reloadStatus
=
logger
.
startProgress
(
'Performing hot reload'
);
Event
result
=
await
observatory
.
reloadSources
(
observatory
.
firstIsolateId
);
reloadStatus
.
stop
(
showElapsedTime:
true
);
dynamic
error
=
result
.
response
[
'reloadError'
];
if
(
error
!=
null
)
{
printError
(
'
Error reloading application sources:
$error
'
);
try
{
await
observatory
.
reloadSources
(
observatory
.
firstIsolateId
);
}
catch
(
errorMessage
)
{
reloadStatus
.
stop
(
showElapsedTime:
true
);
printError
(
'
Hot reload was rejected:
\n
$errorMessage
'
);
return
false
;
}
reloadStatus
.
stop
(
showElapsedTime:
true
);
Status
reassembleStatus
=
logger
.
startProgress
(
'Reassembling application'
);
await
observatory
.
flutterReassemble
(
observatory
.
firstIsolateId
);
...
...
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