Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1770)

Unified Diff: sdk/lib/_internal/pub_generated/lib/src/exceptions.dart

Issue 557563002: Store the async-await compiled pub code directly in the repo. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/pub_generated/lib/src/exceptions.dart
diff --git a/sdk/lib/_internal/pub_generated/lib/src/exceptions.dart b/sdk/lib/_internal/pub_generated/lib/src/exceptions.dart
new file mode 100644
index 0000000000000000000000000000000000000000..f3851a5e948dfa1f14aec16977cb9a5f6c95f040
--- /dev/null
+++ b/sdk/lib/_internal/pub_generated/lib/src/exceptions.dart
@@ -0,0 +1,74 @@
+library pub.exceptions;
+import 'dart:io';
+import 'dart:isolate';
+import "package:analyzer/analyzer.dart";
+import "package:http/http.dart" as http;
+import "package:stack_trace/stack_trace.dart";
+import "package:yaml/yaml.dart";
+import '../../asset/dart/serialize.dart';
+class ApplicationException implements Exception {
+ final String message;
+ ApplicationException(this.message);
+ String toString() => message;
+}
+class FileException implements ApplicationException {
+ final String message;
+ final String path;
+ FileException(this.message, this.path);
+ String toString() => message;
+}
+class WrappedException extends ApplicationException {
+ final innerError;
+ final Chain innerChain;
+ WrappedException(String message, this.innerError, [StackTrace innerTrace])
+ : innerChain = innerTrace == null ? null : new Chain.forTrace(innerTrace),
+ super(message);
+}
+class SilentException extends WrappedException {
+ SilentException(innerError, [StackTrace innerTrace])
+ : super(innerError.toString(), innerError, innerTrace);
+}
+class UsageException extends ApplicationException {
+ String _usage;
+ UsageException(String message, this._usage) : super(message);
+ String toString() => "$message\n\n$_usage";
+}
+class DataException extends ApplicationException {
+ DataException(String message) : super(message);
+}
+class PackageNotFoundException extends WrappedException {
+ PackageNotFoundException(String message, [innerError, StackTrace innerTrace])
+ : super(message, innerError, innerTrace);
+}
+final _userFacingExceptions = new Set<String>.from(
+ [
+ 'ApplicationException',
+ 'GitException',
+ 'ClientException',
+ 'AnalyzerError',
+ 'AnalyzerErrorGroup',
+ 'IsolateSpawnException',
+ 'CertificateException',
+ 'FileSystemException',
+ 'HandshakeException',
+ 'HttpException',
+ 'IOException',
+ 'ProcessException',
+ 'RedirectException',
+ 'SignalException',
+ 'SocketException',
+ 'StdoutException',
+ 'TlsException',
+ 'WebSocketException']);
+bool isUserFacingException(error) {
+ if (error is CrossIsolateException) {
+ return _userFacingExceptions.contains(error.type);
+ }
+ return error is ApplicationException ||
+ error is AnalyzerError ||
+ error is AnalyzerErrorGroup ||
+ error is IsolateSpawnException ||
+ error is IOException ||
+ error is http.ClientException ||
+ error is YamlException;
+}

Powered by Google App Engine
This is Rietveld 408576698