Include file path in JSON error when possible.

I also cleaned up a bunch of unused imports.

BUG=https://code.google.com/p/dart/issues/detail?id=20067
[email protected]

Review URL: https://codereview.chromium.org//391363004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge@38352 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/lib/src/pubspec.dart b/lib/src/pubspec.dart
index 3291b34..dafb513 100644
--- a/lib/src/pubspec.dart
+++ b/lib/src/pubspec.dart
@@ -223,7 +223,9 @@
     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,