Skip to content

Introducing IProblemDetailsService.TryWriteAsync #46680

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 6 commits into from
Feb 17, 2023

Conversation

brunolins16
Copy link
Member

@brunolins16 brunolins16 commented Feb 15, 2023

Fixes #45678

This PR introduces a new public api (#45678 (comment)) and also drop the restriction to create Problem Details only when the status code is >= 400

@brunolins16 brunolins16 marked this pull request as ready for review February 16, 2023 23:44
{
return ValueTask.CompletedTask;
throw new InvalidOperationException("Unable to find a registered `IProblemDetailsWriter` that can write to the given context.");
Copy link
Member

Choose a reason for hiding this comment

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

Throwing is a breaking behavior change?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is but I believe it is consistent with TryParse/Parse approach. However, I ok to not do that and avoid this breaking change

@brunolins16 brunolins16 merged commit 138aabb into dotnet:main Feb 17, 2023
@brunolins16 brunolins16 deleted the brunolins16/issues/pd/45678-api branch February 17, 2023 19:05
@ghost ghost added this to the 8.0-preview2 milestone Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants