-
Notifications
You must be signed in to change notification settings - Fork 10.6k
ProblemDetails is not returned for 404NotFound and 500Exception #4953
Copy link
Copy link
Closed
Labels
Priority:3Work that is nice to haveWork that is nice to haveaffected-mediumThis issue impacts approximately half of our customersThis issue impacts approximately half of our customersenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onefeature-openapiold-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labelsseverity-minorThis label is used by an internal toolThis label is used by an internal tool
Milestone
Metadata
Metadata
Assignees
Labels
Priority:3Work that is nice to haveWork that is nice to haveaffected-mediumThis issue impacts approximately half of our customersThis issue impacts approximately half of our customersenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onefeature-openapiold-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labelsseverity-minorThis label is used by an internal toolThis label is used by an internal tool
Type
Fields
Give feedbackNo fields configured for issues without a type.
Describe the bug
Given a new ASPNET Core 2.2 "API" Website,
ProblemDetailsare not returned when:ActionMethod.I understand that currently
ProblemDetailsare provided when aControlleris decorated withApiController. So the first scenario (route doesn't exist/match) can't currently be handled. The second scenario (exeception thrown) is inside anController/ActionMethodthat has been decorated.ProblemDetailsshould apply globally, not just on a half-specific set of scenario's. This breaks application-consistency.Currently, the only workaround is to use @khellang 's
ProblemDetailsnuget library (part of his 'Middleware' repo).Would be very helpful to either consider:
a) implementing the full functionality
b) just removing it because the current implementation feels inconsistent / half-complete. (NOTE: please don't remove it! lets complete it!!)
To Reproduce
Startup.cs. Comment out\\ app.UseDeveloperExceptionPage();Controllers\ValuesControllerto (more or less) the following:I've just added some specific routes to test problem details. (look below 😎 )
Expected behavior
ProblemDetailsto be returned.IsDevelopmentmode.Startup.cs.Additional context
Also using
Visual Studio 15.9.4polite cc @glennc
Thank you kindly for your awesome work and here's Dwayne/TheRock singing sweet nothings to help persuade the decision process, here. Like, who would say 'no' to TheRock??