Chromium Code Reviews| Index: utils/pub/hosted_source.dart |
| diff --git a/utils/pub/hosted_source.dart b/utils/pub/hosted_source.dart |
| index 5a4106e29cac657b57ea2dafe8abcf349f93223c..a9e80cb0761cde4c79f4222c0210fcbf59405318 100644 |
| --- a/utils/pub/hosted_source.dart |
| +++ b/utils/pub/hosted_source.dart |
| @@ -133,16 +133,19 @@ class HostedSource extends Source { |
| void _throwFriendlyError(error, package, url) { |
| if (error is PubHttpException && |
| error.response.statusCode == 404) { |
| - throw 'Could not find package "$package" at $url.'; |
| + throw new UserFacingException('Could not find package "$package" at ' |
| + '$url.'); |
| } |
| if (error is TimeoutException) { |
| - throw 'Timed out trying to find package "$package" at $url.'; |
| + throw new UserFacingException('Timed out trying to find package ' |
| + '"$package" at $url.'); |
| } |
| if (error is io.SocketIOException) { |
| - throw 'Got socket error trying to find package "$package" at $url.\n' |
| - '${error.osError}'; |
| + throw new UserFacingException('Got socket error trying to find package ' |
| + '"$package" at $url.\n' |
|
Bob Nystrom
2013/04/18 18:18:31
Nit, but I would probably move the whole string to
nweiz
2013/04/18 18:37:24
This was reformatted anyway due to [fail].
|
| + '${error.osError}'); |
| } |
| // Otherwise re-throw the original exception. |