Skip to content

Commit

Permalink
Add unparsable.
Browse files Browse the repository at this point in the history
  • Loading branch information
Corniel committed Nov 15, 2023
1 parent d20dd7b commit fe6e528
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
/// <paramref name="s"/> is not in the correct format.
/// </exception>
[Pure]
public static @TSvo Parse(string? s, IFormatProvider? formatProvider) => TryParse(s, formatProvider) ?? throw new FormatException(@FormatExceptionMessage);
public static @TSvo Parse(string? s, IFormatProvider? formatProvider)
=> TryParse(s, formatProvider)
?? throw Unparsable.ForValue<@TSvo>(s, @FormatExceptionMessage);

/// <summary>Converts the <see cref="string"/> to <see cref="@TSvo"/>.</summary>
/// <param name="s">
Expand Down

0 comments on commit fe6e528

Please sign in to comment.