Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 122acaa

Browse files
dezsiszabidanmoseley
authored andcommitted
Extending FormatException's message with datetime/format (#15635)
* Extending FormatException's message with datetime/format * Applying feedback from review
1 parent 6f410d2 commit 122acaa

File tree

2 files changed

+231
-189
lines changed

2 files changed

+231
-189
lines changed

src/mscorlib/Resources/Strings.resx

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2312,16 +2312,19 @@
23122312
<value>Could not determine the order of year, month, and date from '{0}'.</value>
23132313
</data>
23142314
<data name="Format_BadDateTime" xml:space="preserve">
2315-
<value>String was not recognized as a valid DateTime.</value>
2315+
<value>String '{0}' was not recognized as a valid DateTime.</value>
23162316
</data>
23172317
<data name="Format_BadDateTimeCalendar" xml:space="preserve">
2318-
<value>The DateTime represented by the string is not supported in calendar {0}.</value>
2318+
<value>The DateTime represented by the string '{0}' is not supported in calendar '{1}'.</value>
23192319
</data>
23202320
<data name="Format_BadDayOfWeek" xml:space="preserve">
2321-
<value>String was not recognized as a valid DateTime because the day of week was incorrect.</value>
2321+
<value>String '{0}' was not recognized as a valid DateTime because the day of week was incorrect.</value>
23222322
</data>
23232323
<data name="Format_BadFormatSpecifier" xml:space="preserve">
2324-
<value>Format specifier was invalid.</value>
2324+
<value>Format specifier '{0}' was invalid.</value>
2325+
</data>
2326+
<data name="Format_NoFormatSpecifier" xml:space="preserve">
2327+
<value>No format specifiers were provided.</value>
23252328
</data>
23262329
<data name="Format_BadQuote" xml:space="preserve">
23272330
<value>Cannot find a matching quote character for the character '{0}'.</value>
@@ -2330,7 +2333,7 @@
23302333
<value>String was not recognized as a valid TimeSpan.</value>
23312334
</data>
23322335
<data name="Format_DateOutOfRange" xml:space="preserve">
2333-
<value>The DateTime represented by the string is out of range.</value>
2336+
<value>The DateTime represented by the string '{0}' is out of range.</value>
23342337
</data>
23352338
<data name="Format_EmptyInputString" xml:space="preserve">
23362339
<value>Input string was either empty or contained only whitespace.</value>
@@ -2378,7 +2381,7 @@
23782381
<value>Input string was not in a correct format.</value>
23792382
</data>
23802383
<data name="Format_MissingIncompleteDate" xml:space="preserve">
2381-
<value>There must be at least a partial date with a year present in the input.</value>
2384+
<value>There must be at least a partial date with a year present in the input string '{0}'.</value>
23822385
</data>
23832386
<data name="Format_NeedSingleChar" xml:space="preserve">
23842387
<value>String must be exactly one character long.</value>
@@ -2387,19 +2390,19 @@
23872390
<value>Could not find any recognizable digits.</value>
23882391
</data>
23892392
<data name="Format_OffsetOutOfRange" xml:space="preserve">
2390-
<value>The time zone offset must be within plus or minus 14 hours.</value>
2393+
<value>The time zone offset of string '{0}' must be within plus or minus 14 hours.</value>
23912394
</data>
23922395
<data name="Format_RepeatDateTimePattern" xml:space="preserve">
23932396
<value>DateTime pattern '{0}' appears more than once with different values.</value>
23942397
</data>
23952398
<data name="Format_StringZeroLength" xml:space="preserve">
23962399
<value>String cannot have zero length.</value>
23972400
</data>
2398-
<data name="Format_UnknowDateTimeWord" xml:space="preserve">
2399-
<value>The string was not recognized as a valid DateTime. There is an unknown word starting at index {0}.</value>
2401+
<data name="Format_UnknownDateTimeWord" xml:space="preserve">
2402+
<value>The string '{0}' was not recognized as a valid DateTime. There is an unknown word starting at index '{1}'.</value>
24002403
</data>
24012404
<data name="Format_UTCOutOfRange" xml:space="preserve">
2402-
<value>The UTC representation of the date falls outside the year range 1-9999.</value>
2405+
<value>The UTC representation of the date '{0}' falls outside the year range 1-9999.</value>
24032406
</data>
24042407
<data name="Globalization_cp_1200" xml:space="preserve">
24052408
<value>Unicode</value>
@@ -3697,4 +3700,4 @@
36973700
<data name="Arg_TypeNotSupported" xml:space="preserve">
36983701
<value>Specified type is not supported</value>
36993702
</data>
3700-
</root>
3703+
</root>

0 commit comments

Comments
 (0)