[flutter_tools] dont let crash reporter crash tool (#66755)

package:http can throw a ClientException, which the crash reporter must catch or the tool will crash in the crash reporter. 3/4 crash on dev.
This commit is contained in:
Jonah Williams
2020-09-30 15:26:25 -07:00
committed by GitHub
parent 0f90747bb3
commit b6768ec7a6
2 changed files with 20 additions and 1 deletions

View File

@@ -188,7 +188,7 @@ class CrashReportSender {
// Catch all exceptions to print the message that makes clear that the
// crash logger crashed.
} catch (sendError, sendStackTrace) { // ignore: avoid_catches_without_on_clauses
if (sendError is SocketException || sendError is HttpException) {
if (sendError is SocketException || sendError is HttpException || sendError is http.ClientException) {
_logger.printError('Failed to send crash report due to a network error: $sendError');
} else {
// If the sender itself crashes, just print. We did our best.