Commit 8da84b1c authored by John McCutchan's avatar John McCutchan Committed by GitHub

Make flutter tools crash log writing fail gracefully (#6122)

parent d9bbd2fb
......@@ -155,7 +155,18 @@ Future<File> _createCrashReport(List<String> args, dynamic error, Chain chain) a
buffer.writeln('## flutter doctor\n');
buffer.writeln('```\n${await _doctorText()}```');
try {
crashFile.writeAsStringSync(buffer.toString());
} on FileSystemException catch (_) {
// Fallback to the system temporary directory.
crashFile = getUniqueFile(Directory.systemTemp, 'flutter', 'log');
try {
crashFile.writeAsStringSync(buffer.toString());
} on FileSystemException catch (e) {
printError('Could not write crash report to disk: $e');
printError(buffer.toString());
}
}
return crashFile;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment