Skip to content

Commit 243222c

Browse files
authored
Include error message in crash reports (flutter#24632)
This modifies our flutter_tools crash reports to include the error message. This error message may contain personally identifying information (PII), such as a file system path on the developer's local machine that may contain user names, project code names, etc. To disable crash reporting, the developer can run the following command: flutter config --no-analytics For more information on what gets reported during crashes of the flutter tool, see: https://github.com/flutter/flutter/wiki/Flutter-CLI-crash-reporting
1 parent 280bbef commit 243222c

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

packages/flutter_tools/lib/src/crash_reporting.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ class CrashReportSender {
107107
req.fields['osVersion'] = os.name; // this actually includes version
108108
req.fields['type'] = _kDartTypeId;
109109
req.fields['error_runtime_type'] = '${error.runtimeType}';
110+
req.fields['error_message'] = '$error';
110111

111112
final String stackTraceWithRelativePaths = Chain.parse(stackTrace.toString()).terse.toString();
112113
req.files.add(http.MultipartFile.fromString(

packages/flutter_tools/test/crash_reporting_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ void main() {
107107
expect(fields['osVersion'], 'fake OS name and version');
108108
expect(fields['type'], 'DartError');
109109
expect(fields['error_runtime_type'], 'StateError');
110+
expect(fields['error_message'], 'Bad state: Test bad state error');
110111

111112
final BufferLogger logger = context[Logger];
112113
expect(logger.statusText, 'Sending crash report to Google.\n'

0 commit comments

Comments
 (0)