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
1f210275
Unverified
Commit
1f210275
authored
Nov 06, 2020
by
Jonah Williams
Committed by
GitHub
Nov 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] wrap http send in async guard (#69972)
parent
75e8428b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
crash_reporting.dart
...ages/flutter_tools/lib/src/reporting/crash_reporting.dart
+13
-10
reporting.dart
packages/flutter_tools/lib/src/reporting/reporting.dart
+1
-0
No files found.
packages/flutter_tools/lib/src/reporting/crash_reporting.dart
View file @
1f210275
...
...
@@ -175,16 +175,19 @@ class CrashReportSender {
filename:
_kStackTraceFilename
,
));
final
http
.
StreamedResponse
resp
=
await
_client
.
send
(
req
);
if
(
resp
.
statusCode
==
200
)
{
final
String
reportId
=
await
http
.
ByteStream
(
resp
.
stream
)
.
bytesToString
();
_logger
.
printTrace
(
'Crash report sent (report ID:
$reportId
)'
);
_crashReportSent
=
true
;
}
else
{
_logger
.
printError
(
'Failed to send crash report. Server responded with HTTP status code
${resp.statusCode}
'
);
}
// package:http may throw unhandled async exceptions into the Zone.
await
asyncGuard
(()
async
{
final
http
.
StreamedResponse
resp
=
await
_client
.
send
(
req
);
if
(
resp
.
statusCode
==
HttpStatus
.
ok
)
{
final
String
reportId
=
await
http
.
ByteStream
(
resp
.
stream
)
.
bytesToString
();
_logger
.
printTrace
(
'Crash report sent (report ID:
$reportId
)'
);
_crashReportSent
=
true
;
}
else
{
_logger
.
printError
(
'Failed to send crash report. Server responded with HTTP status code
${resp.statusCode}
'
);
}
});
// Catch all exceptions to print the message that makes clear that the
// crash logger crashed.
}
catch
(
sendError
,
sendStackTrace
)
{
// ignore: avoid_catches_without_on_clauses
...
...
packages/flutter_tools/lib/src/reporting/reporting.dart
View file @
1f210275
...
...
@@ -12,6 +12,7 @@ import 'package:intl/intl.dart';
import
'package:meta/meta.dart'
;
import
'package:usage/usage_io.dart'
;
import
'../base/async_guard.dart'
;
import
'../base/error_handling_io.dart'
;
import
'../base/file_system.dart'
;
import
'../base/io.dart'
;
...
...
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