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

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

Issue 324213003: Change DateTime.parse FormatException messages; update tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 | « no previous file | tests/corelib/date_time_test.dart » ('j') | tests/corelib/date_time_test.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..549e630b5aa9140ad89eae43cf5ebbce7be6cc05 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('Out of range: $formattedString');
Lasse Reichstein Nielsen 2014/08/04 07:25:47 Use: new FormattedException("Date out of range",
srawlins 2014/08/04 19:58:30 Done.
}
if (addOneMillisecond) millisecondsSinceEpoch++;
return new DateTime.fromMillisecondsSinceEpoch(millisecondsSinceEpoch,
isUtc: isUtc);
} else {
- throw new FormatException(formattedString);
+ throw new FormatException('Could not parse: $formattedString');
Lasse Reichstein Nielsen 2014/08/04 07:25:47 throw new FormatException("Invalid DateTime format
srawlins 2014/08/04 19:58:30 Done.
}
}
« no previous file with comments | « no previous file | tests/corelib/date_time_test.dart » ('j') | tests/corelib/date_time_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698