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

Unified Diff: sdk/lib/_internal/pub/lib/src/pubspec.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/pubspec.dart
diff --git a/sdk/lib/_internal/pub/lib/src/pubspec.dart b/sdk/lib/_internal/pub/lib/src/pubspec.dart
index 3291b34dbfe5bf1c7f3391e614c004186a02fbc4..dafb5136f535207e0e99b86a52d0b6bcdf271146 100644
--- a/sdk/lib/_internal/pub/lib/src/pubspec.dart
+++ b/sdk/lib/_internal/pub/lib/src/pubspec.dart
@@ -223,7 +223,9 @@ class Pubspec {
var pubspecPath = path.join(packageDir, 'pubspec.yaml');
var pubspecUri = path.toUri(pubspecPath);
if (!fileExists(pubspecPath)) {
- fail('Could not find a file named "pubspec.yaml" in "$packageDir".');
+ throw new FileException(
+ 'Could not find a file named "pubspec.yaml" in "$packageDir".',
+ pubspecPath);
}
return new Pubspec.parse(readTextFile(pubspecPath), sources,

Powered by Google App Engine
This is Rietveld 408576698