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

Unified Diff: sdk/lib/core/date_time.dart

Issue 389603002: Add extra information to FormatException. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. 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/core/date_time.dart
diff --git a/sdk/lib/core/date_time.dart b/sdk/lib/core/date_time.dart
index 2e93ad1206e40994b84586f07463ebc14567624f..5cc9707a88eda48bf771d376c22cfa6b458325cc 100644
--- a/sdk/lib/core/date_time.dart
+++ b/sdk/lib/core/date_time.dart
@@ -282,13 +282,13 @@ class DateTime implements Comparable {
int millisecondsSinceEpoch = _brokenDownDateToMillisecondsSinceEpoch(
years, month, day, hour, minute, second, millisecond, isUtc);
if (millisecondsSinceEpoch == null) {
- throw new FormatException(formattedString);
+ throw new FormatException("Time out of range", formattedString);
}
if (addOneMillisecond) millisecondsSinceEpoch++;
return new DateTime.fromMillisecondsSinceEpoch(millisecondsSinceEpoch,
isUtc: isUtc);
} else {
- throw new FormatException(formattedString);
+ throw new FormatException("Invalid date format", formattedString);
}
}

Powered by Google App Engine
This is Rietveld 408576698