| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** | 5 /** |
| 6 * Helper functionality to make working with IO easier. | 6 * Helper functionality to make working with IO easier. |
| 7 */ | 7 */ |
| 8 library io; | 8 library io; |
| 9 | 9 |
| 10 import 'dart:io'; | 10 import 'dart:io'; |
| (...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 } | 705 } |
| 706 | 706 |
| 707 /** | 707 /** |
| 708 * Exception thrown when an HTTP operation fails. | 708 * Exception thrown when an HTTP operation fails. |
| 709 */ | 709 */ |
| 710 class PubHttpException implements Exception { | 710 class PubHttpException implements Exception { |
| 711 final int statusCode; | 711 final int statusCode; |
| 712 final String reason; | 712 final String reason; |
| 713 | 713 |
| 714 const PubHttpException(this.statusCode, this.reason); | 714 const PubHttpException(this.statusCode, this.reason); |
| 715 |
| 716 String toString() => 'HTTP error $statusCode: $reason'; |
| 715 } | 717 } |
| 716 | 718 |
| 717 /** | 719 /** |
| 718 * Exception thrown when an operation times out. | 720 * Exception thrown when an operation times out. |
| 719 */ | 721 */ |
| 720 class TimeoutException implements Exception { | 722 class TimeoutException implements Exception { |
| 721 final String message; | 723 final String message; |
| 722 | 724 |
| 723 const TimeoutException(this.message); | 725 const TimeoutException(this.message); |
| 726 |
| 727 String toString() => message; |
| 724 } | 728 } |
| 725 | 729 |
| 726 /** | 730 /** |
| 727 * Contains the results of invoking a [Process] and waiting for it to complete. | 731 * Contains the results of invoking a [Process] and waiting for it to complete. |
| 728 */ | 732 */ |
| 729 class PubProcessResult { | 733 class PubProcessResult { |
| 730 final List<String> stdout; | 734 final List<String> stdout; |
| 731 final List<String> stderr; | 735 final List<String> stderr; |
| 732 final int exitCode; | 736 final int exitCode; |
| 733 | 737 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 757 return new Directory(entry); | 761 return new Directory(entry); |
| 758 } | 762 } |
| 759 | 763 |
| 760 /** | 764 /** |
| 761 * Gets a [Uri] for [uri], which can either already be one, or be a [String]. | 765 * Gets a [Uri] for [uri], which can either already be one, or be a [String]. |
| 762 */ | 766 */ |
| 763 Uri _getUri(uri) { | 767 Uri _getUri(uri) { |
| 764 if (uri is Uri) return uri; | 768 if (uri is Uri) return uri; |
| 765 return new Uri.fromString(uri); | 769 return new Uri.fromString(uri); |
| 766 } | 770 } |
| OLD | NEW |