-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Description
Description
I am looking into the Social Auth sample here:
and would like to Upgrade this to TypedResults to ensure type security 🚀
but now I am a bit stuck with how I can combine a TypedResult.Problem which I would assume to be the closest to the "regular" NotSupportedException we would use on non web targets and the go-to for web is to not throw exceptions then use the return value instead.
The original return has been nothing, but it was also using .Run( which I don't see combine-able with IRouteGroupBuilder .
What I came up with so far:
return TypedResults.Problem(title: $"Provider not supported", detail: "<html><body>No refresh_token is available.<br><a href=\"/\">Home</a></body></html>", statusCode:StatusCodes.Status501NotImplemented);As there is no extension for Problem like .Problem(...).RedirectToRoute("/") and RedirectToRoute has no message to add, I would assume that the extensions overload of it could eventually be used for this ?
But I was unable to find a sample in the current documentation, how I could/should use this 🤔
Could someone recommend something for this to me please and add some note to the docs for others too?
Page URL
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/fundamentals/error-handling-api.md
Document ID
5ad65468-c51c-9899-c435-6e99d734d0b8
Platform Id
bc49b255-ac35-3229-e350-58e76d52238c
Article author
Metadata
- ID: 5ad65468-c51c-9899-c435-6e99d734d0b8
- PlatformId: bc49b255-ac35-3229-e350-58e76d52238c
- Service: aspnet-core
- Sub-service: fundamentals