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

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

Issue 391363004: Include file path in JSON error when possible. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise. Created 6 years, 5 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/lib/src/exceptions.dart
diff --git a/sdk/lib/_internal/pub/lib/src/exceptions.dart b/sdk/lib/_internal/pub/lib/src/exceptions.dart
index 74af539763f4e7a9b7306ec00384c177d56dd157..fc83c0c3c538b75c0ab472fc7c93bee298605535 100644
--- a/sdk/lib/_internal/pub/lib/src/exceptions.dart
+++ b/sdk/lib/_internal/pub/lib/src/exceptions.dart
@@ -26,6 +26,19 @@ class ApplicationException implements Exception {
String toString() => message;
}
+/// An exception class for exceptions that are intended to be seen by the user
+/// and are associated with a problem in a file at some path.
+class FileException implements ApplicationException {
+ final String message;
+
+ /// The path to the file that was missing or erroneous.
+ final String path;
+
+ FileException(this.message, this.path);
+
+ String toString() => message;
+}
+
/// A class for exceptions that wrap other exceptions.
class WrappedException extends ApplicationException {
/// The underlying exception that [this] is wrapping, if any.

Powered by Google App Engine
This is Rietveld 408576698