Skip to content
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

Code only: New APIs in ProblemDetails to support more resilient integrations #28754

Closed
Rick-Anderson opened this issue Mar 24, 2023 · 6 comments · Fixed by #29124
Closed

Code only: New APIs in ProblemDetails to support more resilient integrations #28754

Rick-Anderson opened this issue Mar 24, 2023 · 6 comments · Fixed by #29124
Assignees
Labels
8.0 .NET 8 code help wanted Sample code help wanted. seQUESTered Identifies that an issue has been imported into Quest. Source - Docs.ms Docs Customer feedback via GitHub Issue

Comments

@Rick-Anderson
Copy link
Contributor

Rick-Anderson commented Mar 24, 2023

Problem details

New APIs in ProblemDetails to support more resilient integrations

Put sample code in https://github.com/dotnet/AspNetCore.Docs/tree/main/aspnetcore/fundamentals/minimal-apis/handle-errrors/sample8


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.


Associated WorkItem - 76920

@Rick-Anderson Rick-Anderson added code help wanted Sample code help wanted. 8.0 .NET 8 reQUEST Triggers an issue to be imported into Quest labels Mar 24, 2023
@Rick-Anderson Rick-Anderson added this to To do in Next sprint via automation Mar 24, 2023
@dotnet-bot dotnet-bot added ⌚ Not Triaged Source - Docs.ms Docs Customer feedback via GitHub Issue labels Mar 24, 2023
@Rick-Anderson Rick-Anderson changed the title New APIs in ProblemDetails to support more resilient integrations Code only: New APIs in ProblemDetails to support more resilient integrations Mar 24, 2023
@github-actions github-actions bot added seQUESTered Identifies that an issue has been imported into Quest. and removed reQUEST Triggers an issue to be imported into Quest labels Mar 24, 2023
@Rick-Anderson
Copy link
Contributor Author

@david-acker
Copy link
Member

I'm interested in helping out with this. Should this sample only focus on the new TryWriteAsync API that's mentioned in the blog post?

@brunolins16
Copy link
Member

@Rick-Anderson not sure the plan but we have this new feature as well dotnet/aspnetcore#47651

@Rick-Anderson
Copy link
Contributor Author

Rick-Anderson commented Apr 26, 2023

I'm interested in helping out with this. Should this sample only focus on the new TryWriteAsync API that's mentioned in the blog post?

Yes, that and the new Exception property.

@david-acker let me know if I can help and if you can take this.

@david-acker
Copy link
Member

david-acker commented Apr 29, 2023

@Rick-Anderson I've put up a draft PR with a sample using IProblemDetailsService.TryWriteAsync. Right now it just includes a very simple demo of the fallback behavior when used with the UseStatusCodePages and UseExceptionHandler middleware.

Locally, I tested out the fallback behavior by hitting the endpoints with an Accept header that's not supported by the DefaultProblemDetailsWriter (e.g. text/plain). Would it make sense to mention something about this somewhere (either a code comment or in one of the written docs) to give a simple example of a scenario where the fallback behavior would be used?

Since the Exception property on ProblemDetailsContext will be added in the next .NET 8 Preview, do we want to include this in the sample? Or should this be added in a separate PR once .NET Preview 4 is released?

@Rick-Anderson
Copy link
Contributor Author

@Rick-Anderson I've put up a draft PR with a sample using IProblemDetailsService.TryWriteAsync. Right now it just includes a very simple demo of the fallback behavior when used with the UseStatusCodePages and UseExceptionHandler middleware.

Locally, I tested out the fallback behavior by hitting the endpoints with an Accept header that's not supported by the DefaultProblemDetailsWriter (e.g. text/plain). Would it make sense to mention something about this somewhere (either a code comment or in one of the written docs) to give a simple example of a scenario where the fallback behavior would be used?

Yes, put some code comments in. When we add this to the document, we may move the comments out of code and into the doc.

Since the Exception property on ProblemDetailsContext will be added in the next .NET 8 Preview, do we want to include this in the sample? Or should this be added in a separate PR once .NET Preview 4 is released?

#29126

@Rick-Anderson Rick-Anderson self-assigned this Apr 30, 2023
@Rick-Anderson Rick-Anderson removed this from To do in Next sprint Apr 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.0 .NET 8 code help wanted Sample code help wanted. seQUESTered Identifies that an issue has been imported into Quest. Source - Docs.ms Docs Customer feedback via GitHub Issue
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants