| Index: utils/pub/utils.dart
|
| diff --git a/utils/pub/utils.dart b/utils/pub/utils.dart
|
| index 5e80e5701c37b52df45d4ff7dcc0fc435da5dd27..77ae1579b64c9cfeb0834a0324d63c4d57bade24 100644
|
| --- a/utils/pub/utils.dart
|
| +++ b/utils/pub/utils.dart
|
| @@ -7,6 +7,7 @@ library utils;
|
|
|
| import 'dart:async';
|
| import 'dart:crypto';
|
| +import 'dart:io';
|
| import 'dart:isolate';
|
| import 'dart:uri';
|
|
|
| @@ -358,3 +359,29 @@ Future awaitObject(object) {
|
| return map;
|
| });
|
| }
|
| +
|
| +/// An exception class for exceptions that are intended to be seen by the user.
|
| +/// These exceptions won't have any debugging information printed when they're
|
| +/// thrown.
|
| +class UserFacingException implements Exception {
|
| + final String message;
|
| +
|
| + UserFacingException(this.message);
|
| +}
|
| +
|
| +/// Returns whether [error] is a user-facing error object. This includes both
|
| +/// [UserFacingException] and any dart:io errors.
|
| +bool isUserFacingException(error) {
|
| + return error is UserFacingException ||
|
| + // TODO(nweiz): clean up this branch when issue 9955 is fixed.
|
| + error is DirectoryIOException ||
|
| + error is FileIOException ||
|
| + error is HttpException ||
|
| + error is HttpParserException ||
|
| + error is LinkIOException ||
|
| + error is MimeParserException ||
|
| + error is OSError ||
|
| + error is ProcessException ||
|
| + error is SocketIOException ||
|
| + error is WebSocketException;
|
| +}
|
|
|