OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'dart:io' hide HttpException; | 6 import 'dart:io' hide HttpException; |
7 | 7 |
8 import 'buildbot_data.dart'; | 8 import 'buildbot_data.dart'; |
9 import 'buildbot_loading.dart'; | 9 import 'buildbot_loading.dart'; |
10 import 'buildbot_structures.dart'; | 10 import 'buildbot_structures.dart'; |
(...skipping 12 matching lines...) Expand all Loading... |
23 } | 23 } |
24 | 24 |
25 /// Buildbot client that pulls build bot results through http. | 25 /// Buildbot client that pulls build bot results through http. |
26 class HttpBuildbotClient implements BuildbotClient { | 26 class HttpBuildbotClient implements BuildbotClient { |
27 final HttpClient _client = new HttpClient(); | 27 final HttpClient _client = new HttpClient(); |
28 | 28 |
29 @override | 29 @override |
30 Future<BuildResult> readResult(BuildUri buildUri) async { | 30 Future<BuildResult> readResult(BuildUri buildUri) async { |
31 try { | 31 try { |
32 return await readBuildResultFromHttp(_client, buildUri); | 32 return await readBuildResultFromHttp(_client, buildUri); |
33 } on HttpException { | 33 } on HttpException catch (e) { |
| 34 return null; |
| 35 } on SocketException catch (e) { |
34 return null; | 36 return null; |
35 } | 37 } |
36 } | 38 } |
37 | 39 |
38 int get mostRecentBuildNumber => -2; | 40 int get mostRecentBuildNumber => -2; |
39 | 41 |
40 @override | 42 @override |
41 void close() { | 43 void close() { |
42 _client.close(); | 44 _client.close(); |
43 } | 45 } |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 buildUri = buildUri.withBuildNumber(buildNumber); | 89 buildUri = buildUri.withBuildNumber(buildNumber); |
88 } | 90 } |
89 } | 91 } |
90 } | 92 } |
91 | 93 |
92 @override | 94 @override |
93 void close() { | 95 void close() { |
94 // Nothing to do. | 96 // Nothing to do. |
95 } | 97 } |
96 } | 98 } |
OLD | NEW |