Repository navigation
Correct and complete the UnhandledExceptionHandling attribute documentation - #1283
Open
SeanKilleen wants to merge 2 commits into
Open
SeanKilleen wants to merge 2 commits into
SeanKilleen wants to merge 2 commits into
Conversation
…tation The `UnhandledExceptionHandling` page existed but had two inaccuracies and a gap, checked against `NUnitTestAssemblyRunner`, `UnhandledExceptionHandlingAttribute` and the framework's own tests: * **Precedence was wrong.** The page said settings at different levels are "combined - each level's configuration is additive". `GetUnhandledExceptionHandlingFor` actually walks method → fixture → assembly and uses the first level with a match; within a level, an entry naming the exception type beats an all-exceptions entry. Replaced with a "Precedence When Applied at Several Levels" section and an example of ignoring everything except one type at the same level. * **Platform behaviour was missing.** On .NET Core / .NET 5+, an unhandled exception on another thread terminates the process regardless of the attribute (the framework tests are limited to `NETFRAMEWORK` for this reason), and unobserved `Task` exceptions are raised on the finalizer thread where NUnit cannot attribute them to a test. Added a "Platform Support" section and rewrote the "Common Scenarios" that used `Task.Run` as if the attribute would catch them. * Added the constructor table, a "When to Use It" section (the issue asked when it is appropriate), fixed the See Also links, and added the missing row on the attributes index page. * Updated the two snippet examples that spawned tasks to use threads that do not throw, with comments explaining why they cannot throw on modern .NET. Snippet tests pass (6 passed, 1 skipped on .NET as before). Fixes #1151 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
📖 Docs preview: https://pr-1283.nunit-docs.pages.dev Built from bfde25a. This link always shows the latest build for this PR; the build for this exact commit is at https://3abcb464.nunit-docs.pages.dev. Previews are hosted on Cloudflare Pages, are not indexed by search engines, and are removed when the PR is closed. They omit the archived NUnit 2.x documentation (the |
Resolve conflicts from the table-alignment sweep in #1284 by keeping the aligned column formatting and re-applying this branch's content changes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This branch has not been deployed
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.
The
UnhandledExceptionHandlingpage existed but had two inaccuracies and a gap, checked againstNUnitTestAssemblyRunner,UnhandledExceptionHandlingAttributeand the framework's own tests:GetUnhandledExceptionHandlingForactually walks method → fixture → assembly and uses the first level with a match; within a level, an entry naming the exception type beats an all-exceptions entry. Replaced with a "Precedence When Applied at Several Levels" section and an example of ignoring everything except one type at the same level.NETFRAMEWORKfor this reason), and unobservedTaskexceptions are raised on the finalizer thread where NUnit cannot attribute them to a test. Added a "Platform Support" section and rewrote the "Common Scenarios" that usedTask.Runas if the attribute would catch them.Fixes #1151
🤖 Generated with Claude Code