Skip to content

Add missing exception documentation for DateTime.TryParseExact #11513

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 26, 2025

Conversation

casuffitsharp
Copy link
Contributor

Summary

This PR adds missing exception documentation to DateTime.TryParseExact to reflect its actual behavior.

  • Documents the FormatException that is thrown when the format string argument itself is invalid.
  • Adds the ArgumentException documentation to overloads where it was missing to ensure consistency.

The new FormatException text is based on the description from DateTime.ToString(format) for consistency with the existing API documentation.

Fixes #10886

@casuffitsharp casuffitsharp requested a review from a team as a code owner June 25, 2025 20:32
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jun 25, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jun 25, 2025
@casuffitsharp
Copy link
Contributor Author

@dotnet-policy-service agree

@casuffitsharp
Copy link
Contributor Author

@tarekgh tagging you as requested

@casuffitsharp casuffitsharp marked this pull request as draft June 25, 2025 20:38
@casuffitsharp casuffitsharp marked this pull request as ready for review June 25, 2025 20:47
@casuffitsharp casuffitsharp reopened this Jun 25, 2025
@tarekgh tarekgh added area-System.DateTime and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Jun 26, 2025
Copy link
Member

@tarekgh tarekgh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Thanks @casuffitsharp

@tarekgh
Copy link
Member

tarekgh commented Jun 26, 2025

@gewarren do you want to have a quick look at this one before I merge it? Also, do you know why the preview page is not generated to look at the visuals of the change?

Copy link
Contributor

@gewarren gewarren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. You can get to the preview from here:

image

image

@casuffitsharp
Copy link
Contributor Author

@gewarren should the preview be accessible for us too? Just to confirm, because I can't access (requires login)

@tarekgh tarekgh merged commit a150563 into dotnet:main Jun 26, 2025
5 of 6 checks passed
@casuffitsharp casuffitsharp deleted the 10886 branch June 26, 2025 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.DateTime community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incomplete documentation on DateTime.TryParseExact
3 participants