Fix ClientErrorMapping 500 title to match RFC 9110#65590
Open
kubaflo wants to merge 1 commit intodotnet:mainfrom
Open
Fix ClientErrorMapping 500 title to match RFC 9110#65590kubaflo wants to merge 1 commit intodotnet:mainfrom
kubaflo wants to merge 1 commit intodotnet:mainfrom
Conversation
Change the ProblemDetails default title for status 500 from 'An error occurred while processing your request.' to 'Internal Server Error' to match RFC 9110 and ReasonPhrases.GetReasonPhrase(500). All other status codes already use the RFC-standard reason phrase as their title. Fixes dotnet#16880 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
Thanks for your PR, @@kubaflo. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Contributor
There was a problem hiding this comment.
Pull request overview
Aligns the default ProblemDetails title for HTTP 500 with the RFC 9110 reason phrase to keep ProblemDetailsDefaults consistent with ReasonPhrases.GetReasonPhrase(500) and the other default mappings.
Changes:
- Updated the 500 default title in
ProblemDetailsDefaultsto"Internal Server Error". - Updated affected unit tests to assert the new 500 title across MVC, Http.Results, and Http.Extensions.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Shared/ProblemDetails/ProblemDetailsDefaults.cs | Changes the default 500 ProblemDetails title to the RFC 9110 reason phrase. |
| src/Mvc/Mvc.Core/test/Infrastructure/ProblemDetailsFactoryTest.cs | Updates default 500 title assertion. |
| src/Mvc/Mvc.Core/test/ControllerBaseTest.cs | Updates Problem() and ClientErrorMapping[500] title assertions. |
| src/Http/Http.Results/test/TypedResultsTests.cs | Updates 500 problem result title assertion. |
| src/Http/Http.Results/test/ResultsTests.cs | Updates 500 problem result title assertion. |
| src/Http/Http.Results/test/ProblemResultTests.cs | Updates 500 problem JSON title assertions. |
| src/Http/Http.Results/test/JsonResultTests.cs | Updates 500 problem JSON title assertion. |
| src/Http/Http.Extensions/test/ProblemDetailsDefaultWriterTest.cs | Updates default writer 500 title assertion. |
3 tasks
mikekistler
approved these changes
Mar 2, 2026
Contributor
mikekistler
left a comment
There was a problem hiding this comment.
This looks good to me and it addresses a long outstanding issue. 👍
DeagleGross
approved these changes
Mar 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AI Summary
🔍 Automated Fix Report
🔍 Pre-Flight — Context & Validation
Issue: #16880 - Inconsistency between ApiBehaviorOptions.ClientErrorMapping and ReasonPhrases using 500
Area: area-mvc (
src/Shared/ProblemDetails/,src/Mvc/Mvc.Core/)PR: None — will create
Key Findings
ProblemDetailsDefaults.csline 136: 500 title is "An error occurred while processing your request."ReasonPhrases.GetReasonPhrase(500)returns "Internal Server Error" (RFC 9110)Fix Approach
Change the 500 title in
ProblemDetailsDefaults.csfrom "An error occurred..." to "Internal Server Error" to match RFC 9110 andReasonPhrases.Test Command
dotnet test src/Mvc/Mvc.Core/test/Microsoft.AspNetCore.Mvc.Core.Test.csproj --filter "ProblemDetailsFactoryTest"🧪 Test — Bug Reproduction
Test Result: ✅ TESTS UPDATED
Existing tests already verify the 500 title value. Updated 9 test assertions across 7 files to expect "Internal Server Error" instead of "An error occurred while processing your request."
🚦 Gate — Test Verification & Regression
Gate Result: ✅ PASSED
All affected tests pass with the updated title string.
🔧 Fix — Analysis & Comparison (✅ 5 passed)
Fix Exploration Summary
Total Attempts: 5
Passing Candidates: 5
Selected Fix: Change "An error occurred while processing your request." to "Internal Server Error"
Attempt Results
Cross-Pollination
All models agree: there is exactly one correct value — "Internal Server Error" from RFC 9110.
Exhausted: Yes
Recommendation
This is a trivial fix with only one correct answer. All models converge to the same solution.
✅ Attempt 0: PASS
Attempt 0 — Baseline (claude-opus-4.6-fast)
Approach: Change ProblemDetailsDefaults.cs line 136 from "An error occurred while processing your request." to "Internal Server Error"
Simple one-line fix + 9 test assertion updates.
📄 Diff
✅ Attempt 1: PASS
Attempt 1 — Model exploration
Approach: Same as attempt 0 — this is a string constant fix with only one correct value.
The 500 title must match RFC 9110: "Internal Server Error". There is no alternative approach.
📄 Diff
✅ Attempt 2: PASS
Attempt 2 — Model exploration
Approach: Same as attempt 0 — this is a string constant fix with only one correct value.
The 500 title must match RFC 9110: "Internal Server Error". There is no alternative approach.
📄 Diff
✅ Attempt 3: PASS
Attempt 3 — Model exploration
Approach: Same as attempt 0 — this is a string constant fix with only one correct value.
The 500 title must match RFC 9110: "Internal Server Error". There is no alternative approach.
📄 Diff
✅ Attempt 4: PASS
Attempt 4 — Model exploration
Approach: Same as attempt 0 — this is a string constant fix with only one correct value.
The 500 title must match RFC 9110: "Internal Server Error". There is no alternative approach.
📄 Diff