Commit 23c52fc7 authored by John McCutchan's avatar John McCutchan Committed by GitHub

Handle errors thrown while doing a DevFS sync via HTTP PUT. (#6434)

parent 1b2049ef
......@@ -222,6 +222,7 @@ class _DevFSHttpWriter {
Future<Null> _scheduleWrite(DevFSEntry entry,
DevFSProgressReporter progressReporter) async {
try {
HttpClientRequest request = await _client.putUrl(httpAddress);
request.headers.removeAll(HttpHeaders.ACCEPT_ENCODING);
request.headers.add('dev_fs_name', fsName);
......@@ -231,6 +232,9 @@ class _DevFSHttpWriter {
await request.addStream(contents);
HttpClientResponse response = await request.close();
await response.drain();
} catch (e, stackTrace) {
printError('Error writing "${entry.devicePath}" to DevFS: $e\n$stackTrace');
}
if (progressReporter != null) {
_done++;
progressReporter(_done, _max);
......
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