Commit fb03b313 authored by Dan Rubel's avatar Dan Rubel Committed by GitHub

Improve error message if update cache interrupted during download (#6740)

parent 04e7446b
......@@ -27,9 +27,16 @@ Future<List<int>> fetchUrl(Uri url) async {
);
}
BytesBuilder responseBody = new BytesBuilder(copy: false);
await for (List<int> chunk in response)
responseBody.add(chunk);
try {
BytesBuilder responseBody = new BytesBuilder(copy: false);
await for (List<int> chunk in response)
responseBody.add(chunk);
return responseBody.takeBytes();
return responseBody.takeBytes();
} on IOException catch (e) {
throw new ToolExit(
'Download failed: $url\n $e',
exitCode: kNetworkProblemExitCode,
);
}
}
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