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

Side by Side Diff: sdk/lib/_internal/pub/lib/src/solver/version_solver.dart

Issue 24246002: Lazily throw pubspec parsing exceptions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library pub.solver.version_solver; 5 library pub.solver.version_solver;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import "dart:convert"; 8 import "dart:convert";
9 9
10 import '../lock_file.dart'; 10 import '../lock_file.dart';
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 String _describeDependency(PackageDep dep) => 268 String _describeDependency(PackageDep dep) =>
269 "depends on it from source ${dep.source}"; 269 "depends on it from source ${dep.source}";
270 } 270 }
271 271
272 /// Exception thrown when a dependency on an unknown source name is found. 272 /// Exception thrown when a dependency on an unknown source name is found.
273 class UnknownSourceException extends SolveFailure { 273 class UnknownSourceException extends SolveFailure {
274 UnknownSourceException(String package, Iterable<Dependency> dependencies) 274 UnknownSourceException(String package, Iterable<Dependency> dependencies)
275 : super(package, dependencies); 275 : super(package, dependencies);
276 276
277 String toString() { 277 String toString() {
278 var dep = only(dependencies); 278 var dep = dependencies.single;
279 return "Package '${dep.depender}' depends on '${dep.dep.name}' from " 279 return "Package '${dep.depender}' depends on '${dep.dep.name}' from "
280 "unknown source '${dep.dep.source}'."; 280 "unknown source '${dep.dep.source}'.";
281 } 281 }
282 } 282 }
283 283
284 /// Exception thrown when two packages with the same name and source but 284 /// Exception thrown when two packages with the same name and source but
285 /// different descriptions are depended upon. 285 /// different descriptions are depended upon.
286 class DescriptionMismatchException extends SolveFailure { 286 class DescriptionMismatchException extends SolveFailure {
287 DescriptionMismatchException(String package, 287 DescriptionMismatchException(String package,
288 Iterable<Dependency> dependencies) 288 Iterable<Dependency> dependencies)
289 : super(package, dependencies); 289 : super(package, dependencies);
290 290
291 String get _message => "Incompatible dependencies on '$package'"; 291 String get _message => "Incompatible dependencies on '$package'";
292 292
293 String _describeDependency(PackageDep dep) { 293 String _describeDependency(PackageDep dep) {
294 // TODO(nweiz): Dump descriptions to YAML when that's supported. 294 // TODO(nweiz): Dump descriptions to YAML when that's supported.
295 return "depends on it with description ${JSON.encode(dep.description)}"; 295 return "depends on it with description ${JSON.encode(dep.description)}";
296 } 296 }
297 } 297 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698