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

Unified Diff: utils/pub/version.dart

Issue 10887023: Use new try-catch syntax in runtime/, tools/, and utils/. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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/pub/pub.dart ('k') | utils/template/parser.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/version.dart
diff --git a/utils/pub/version.dart b/utils/pub/version.dart
index 4a37062e618201a4a24a4bbd05a36c9bcc19c8b0..33a8c05c628c4c1bafb8cd308f2b36402ccebf33 100644
--- a/utils/pub/version.dart
+++ b/utils/pub/version.dart
@@ -69,7 +69,7 @@ class Version implements Comparable, Hashable, VersionConstraint {
String build = match[8];
return new Version(major, minor, patch, preRelease, build);
- } catch (FormatException ex) {
+ } on FormatException catch (ex) {
throw new FormatException('Could not parse "$text".');
}
}
@@ -183,7 +183,7 @@ class Version implements Comparable, Hashable, VersionConstraint {
return text.split('.').map((part) {
try {
return parseInt(part);
- } catch (FormatException ex) {
+ } on FormatException catch (ex) {
// Not a number.
return part;
}
« no previous file with comments | « utils/pub/pub.dart ('k') | utils/template/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698