Improve error message if update cache interrupted during download (#6740)
This commit is contained in:
parent
04e7446b2b
commit
fb03b3137e
@ -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,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user