Skip to content

Commit 4d12c1d

Browse files
committed
refactor(GitVersion.Configuration): if value assigned to BeforeString cannot be parsed, throw exception
WhenBadDateFormatShouldFail expects bad strings to cause an exception
1 parent 33fb45c commit 4d12c1d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/GitVersion.Configuration/IgnoreConfiguration.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ internal record IgnoreConfiguration : IIgnoreConfiguration
1313
public string? BeforeString
1414
{
1515
get => Before?.ToString("yyyy-MM-ddTHH:mm:ssZ");
16-
// if TryParse returns false, Before = null and the parse error is suppressed. How should the user be informed of parse errors?
17-
init => Before = value is null ? null : DateTimeOffset.TryParse(value, out DateTimeOffset dto) ? dto : null;
16+
init => Before = value is null ? null : DateTimeOffset.Parse(value);
1817
}
1918

2019
[JsonIgnore]

0 commit comments

Comments
 (0)