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

Unified Diff: utils/tests/pub/version_solver_test.dart

Issue 14253005: Migrate pub away from throwing strings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 7 years, 8 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
« no previous file with comments | « utils/tests/pub/test_pub.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/tests/pub/version_solver_test.dart
diff --git a/utils/tests/pub/version_solver_test.dart b/utils/tests/pub/version_solver_test.dart
index d53e0a63115a2648fb782c601fe559d470c67261..2c9d5a9b3abcd93e938e6217143a8c6be1ab4220 100644
--- a/utils/tests/pub/version_solver_test.dart
+++ b/utils/tests/pub/version_solver_test.dart
@@ -819,13 +819,15 @@ class MockSource extends Source {
return new Future.sync(() {
// Make sure the solver doesn't request the same thing twice.
if (_requestedVersions.contains(description)) {
- throw 'Version list for $description was already requested.';
+ throw new Exception('Version list for $description was already '
+ 'requested.');
}
_requestedVersions.add(description);
if (!_packages.containsKey(description)){
- throw 'MockSource does not have a package matching "$description".';
+ throw new Exception('MockSource does not have a package matching '
+ '"$description".');
}
return _packages[description].keys.toList();
});
@@ -836,7 +838,7 @@ class MockSource extends Source {
// Make sure the solver doesn't request the same thing twice.
if (_requestedPubspecs.containsKey(id.description) &&
_requestedPubspecs[id.description].contains(id.version)) {
- throw 'Pubspec for $id was already requested.';
+ throw new Exception('Pubspec for $id was already requested.');
}
_requestedPubspecs.putIfAbsent(id.description, () => new Set<Version>());
@@ -847,7 +849,7 @@ class MockSource extends Source {
}
Future<bool> install(PackageId id, String path) {
- throw 'no';
+ throw new Exception('no');
}
void addPackage(String description, Package package) {
« no previous file with comments | « utils/tests/pub/test_pub.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698