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
ee735c4f
Unverified
Commit
ee735c4f
authored
Apr 20, 2018
by
Yegor
Committed by
GitHub
Apr 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Be specific about which exceptions are retried (#16818)
parent
a90a8504
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
vmservice.dart
packages/flutter_tools/lib/src/vmservice.dart
+16
-5
No files found.
packages/flutter_tools/lib/src/vmservice.dart
View file @
ee735c4f
...
...
@@ -49,15 +49,26 @@ Future<StreamChannel<String>> _defaultOpenChannel(Uri uri) async {
Duration
delay
=
const
Duration
(
milliseconds:
100
);
int
attempts
=
0
;
io
.
WebSocket
socket
;
Future
<
void
>
onError
(
dynamic
e
)
async
{
printTrace
(
'Exception attempting to connect to observatory:
$e
'
);
printTrace
(
'This was attempt #
$attempts
. Will retry in
$delay
.'
);
// Delay next attempt.
await
new
Future
<
Null
>.
delayed
(
delay
);
// Back off exponentially.
delay
*=
2
;
}
while
(
attempts
<
_kMaxAttempts
&&
socket
==
null
)
{
attempts
+=
1
;
try
{
socket
=
await
io
.
WebSocket
.
connect
(
uri
.
toString
());
}
catch
(
e
)
{
printTrace
(
'Exception attempting to connect to observatory:
$e
'
);
printTrace
(
'This was attempt #
$attempts
. Will retry in
$delay
.'
);
await
new
Future
<
Null
>.
delayed
(
delay
);
delay
*=
2
;
}
on
io
.
WebSocketException
catch
(
e
)
{
await
onError
(
e
);
}
on
io
.
SocketException
catch
(
e
)
{
await
onError
(
e
);
}
}
...
...
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